﻿/* style.css */
/* style.css - Updated for Full-Screen Responsive Chat */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Container takes full screen */
.container {
    width: 100%;
    height: 100vh;
    max-width: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Screen takes full container */
.screen {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card {
    padding: 40px 20px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.landing-screen {
    background: radial-gradient(circle at top left, #f5f7ff 0%, #ffffff 55%, #f2f4ff 100%);
}

.landing-shell {
    display: grid;
    grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 0.9fr);
    gap: 32px;
    width: min(1100px, 92vw);
    margin: 0 auto;
    align-items: center;
    padding: 40px 20px;
}

.landing-copy {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.hero-badge {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.15);
    color: #3b4aa3;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    width: fit-content;
}

.landing-copy h1 {
    font-size: clamp(34px, 6vw, 48px);
    margin-bottom: 6px;
    color: #0ea34a;
}

.landing-copy p {
    margin-bottom: 0;
    color: #4d5675;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    width: 100%;
}

.feature-card {
    background: #f6f8ff;
    border-radius: 16px;
    padding: 16px;
    text-align: left;
    box-shadow: 0 10px 25px rgba(52, 66, 130, 0.08);
}

.feature-icon {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #667eea;
    margin-bottom: 10px;
}

.feature-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #2b2f4a;
}

.feature-text {
    color: #5c647a;
    font-size: 14px;
    line-height: 1.4;
}

.steps {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #eef1ff;
    font-weight: 600;
    color: #3b4aa3;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    font-size: 12px;
}

.join-panel {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 40px rgba(40, 54, 120, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.15);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.join-header h2 {
    margin-bottom: 6px;
    font-size: 22px;
}

.join-header p {
    margin: 0;
    color: #6a728c;
    font-size: 14px;
}

.join-subtitle {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #667eea;
}

.join-form {
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: #f7f8ff;
}

.join-form #joinBtn {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4f6ef7 0%, #6f4bd8 100%);
    box-shadow: 0 10px 24px rgba(79, 110, 247, 0.25);
}

.join-form .secondary-btn {
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    background: #eef2ff;
    border: 1px solid #d7dcf8;
    color: #3b4bd7;
    font-weight: 600;
}

.join-form .secondary-btn:hover {
    background: #e3e9ff;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    font-weight: 600;
    color: #2b2f4a;
    font-size: 13px;
}

.field-hint {
    font-size: 11px;
    color: #7a8198;
}

.field input {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #d8dceb;
    font-size: 15px;
    outline: none;
}

.field input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.join-note {
    font-size: 12px;
    color: #6a728c;
    background: #f6f7ff;
    padding: 10px 12px;
    border-radius: 12px;
}

.join-error {
    display: none;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(244, 67, 54, 0.12);
    color: #c62828;
    font-size: 12px;
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: clamp(28px, 5vw, 36px);
}

p {
    color: #666;
    margin-bottom: 40px;
    font-size: clamp(16px, 3vw, 18px);
    line-height: 1.5;
    max-width: 500px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin: 40px 0;
    width: 100%;
    max-width: 500px;
}

input[type="number"] {
    flex: 1;
    padding: 18px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: clamp(16px, 3vw, 18px);
    outline: none;
    transition: border-color 0.3s;
    min-width: 0;
}

input[type="number"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: clamp(16px, 3vw, 18px);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    min-width: 140px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.info {
    margin-top: 50px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: left;
    width: 100%;
    max-width: 500px;
}

.info h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: clamp(18px, 3vw, 20px);
}

.info ul {
    list-style: none;
    color: #666;
}

.info li {
    margin-bottom: 12px;
    padding-left: 30px;
    position: relative;
    font-size: clamp(15px, 2.5vw, 16px);
    line-height: 1.5;
}

.info li:before {
    content: "\2713";
    color: #667eea;
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 18px;
}

/* Chat Screen Styles - Full Screen */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.chat-header {
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    min-height: 56px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.next-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: clamp(14px, 2.5vw, 16px);
    border-radius: 20px;
    color: white;
    font-weight: 600;
}

.next-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.menu-btn {
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 18px;
    min-width: auto;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2100;
}

.menu-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(320px, 86vw);
    background: white;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 2200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.menu-panel.open {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 16px;
    border-bottom: 1px solid #e1e5e9;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 1;
}

.menu-title {
    font-weight: 700;
    font-size: 16px;
}

.menu-close {
    background: transparent;
    border: none;
    font-size: 18px;
    min-width: auto;
    padding: 8px;
}

.menu-section {
    padding: 16px;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-panel {
    padding-bottom: env(safe-area-inset-bottom);
}

.menu-panel .menu-section {
    overflow: visible;
}

.menu-panel {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.menu-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #777;
}

.menu-item {
    padding: 10px 14px;
    border-radius: 10px;
    background: #f5f7fa;
    color: #333;
    font-weight: 600;
    min-width: auto;
}

.menu-online {
    font-size: 14px;
    color: #555;
}

.menu-users {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.menu-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.08);
    color: #2b3448;
}

.menu-user.self {
    border: 1px solid rgba(14, 165, 164, 0.4);
    background: rgba(14, 165, 164, 0.1);
}

.menu-avatar {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.chat-header h2 {
    font-size: clamp(16px, 3.2vw, 20px);
    margin: 0;
}

.header-info {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 15px);
}

#onlineCount {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: clamp(14px, 2.5vw, 16px);
    
}

.leave-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: clamp(14px, 2.5vw, 16px);
    border-radius: 20px;
    transition: background-color 0.3s;
}

.messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f7fa;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

/* Custom scrollbar */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.message {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message-row.own-row {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #667eea;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.message-content {
    display: inline-block;
    width: auto;
    max-width: 85%;
    padding: 4px 8px;
    min-width: 0;
    border-radius: 20px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    line-height: 1.2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
    .message-content {
        padding: 2px 6px;
    }

    .message-sender {
        margin-bottom: 2px;
    }

    .message-time {
        margin-top: 2px;
    }

    .message-meta {
        margin-top: 2px;
    }

    .message {
        margin-bottom: 4px;
    }
}

.own-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.other-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.message-sender {
    font-size: clamp(12px, 2.5vw, 14px);
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
    padding: 0 5px;
}

.own-message .message-sender {
    align-self: flex-end;
    text-align: right;
}

.other-message .message-sender {
    align-self: flex-start;
    text-align: left;
}

.message-text {
    line-height: 1.2;
    font-size: clamp(15px, 2.5vw, 16px);
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: inline-block;
    margin: 0;
    padding: 0;
}

.message-time {
    font-size: clamp(11px, 2vw, 12px);
    margin-top: 4px;
    opacity: 0.8;
    display: block;
    text-align: right;
}

.message-meta {
    display: block;
    width: fit-content;
    margin-top: 4px;
}

.own-message .message-meta {
    align-self: flex-end;
}

.other-message .message-meta {
    align-self: flex-start;
}

.edited-badge {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.7;
}

.message-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    align-self: flex-end;
    opacity: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.search-highlight {
    background: rgba(45, 212, 191, 0.35);
    color: inherit;
    padding: 0 2px;
    border-radius: 4px;
}

.mention-list {
    display: none;
    margin: 0 0 8px 0;
    padding: 8px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.mention-list.show {
    display: block;
}

.mention-item {
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #0f172a;
}

.mention-item + .mention-item {
    margin-top: 6px;
}

.mention-item:hover {
    background: rgba(14, 165, 164, 0.15);
}

.message.show-actions .message-actions {
    opacity: 1;
    height: auto;
    pointer-events: auto;
}

.message-btn {
    padding: 6px 10px;
    min-width: auto;
    border-radius: 12px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.08);
    color: #333;
    box-shadow: none;
}

.message-btn:hover {
    transform: translateY(-1px);
}

.message-btn.danger {
    background: rgba(244, 67, 54, 0.15);
    color: #b71c1c;
}

/* Toasts */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3000;
}

@media (max-width: 768px) {
    .toast-container {
        left: 20px;
        right: 20px;
    }
}

.toast {
    padding: 12px 16px;
    border-radius: 10px;
    color: white;
    background: #2f3640;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.25s ease;
    font-size: 14px;
}

.toast.success {
    background: #2e7d32;
}

.toast.warning {
    background: #f9a825;
    color: #1f1f1f;
}

.toast.error {
    background: #c62828;
}

.toast.hide {
    animation: fadeOut 0.3s ease forwards;
}

/* Name modal */
.modal-content h3 {
    margin-bottom: 8px;
}

.modal-content p {
    margin-bottom: 16px;
    color: #666;
}

.modal-content input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d6dbe1;
    margin-bottom: 14px;
    outline: none;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-btn {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    min-width: auto;
}

.modal-btn.save {
    background: #4caf50;
}

.modal-btn.cancel {
    background: #9e9e9e;
}

/* Inline editor */
.inline-editor {
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 10px;
    max-width: 85%;
    align-self: flex-end;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.inline-editor textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    border: 1px solid #d6dbe1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    outline: none;
}

.inline-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.editor-btn {
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    min-width: auto;
}

.editor-btn.save {
    background: #4caf50;
}

.editor-btn.cancel {
    background: #9e9e9e;
}

.own-message .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.other-message .message-time {
    color: #666;
}

.system-message {
    text-align: center;
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

.system-text {
    display: inline-block;
    padding: 10px 20px;
    background: #e9ecef;
    color: #666;
    border-radius: 20px;
    font-size: clamp(13px, 2.5vw, 14px);
    font-style: italic;
    max-width: 80%;
    word-break: break-word;
}

.message-input-container {
    padding: clamp(15px, 3vw, 20px);
    background: white;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 10px;
    flex-direction: column;
    flex-shrink: 0;
    align-items: stretch;
    flex-wrap: nowrap;
}

#messageInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: clamp(16px, 3vw, 18px);
    outline: none;
    transition: border-color 0.3s;
    min-width: 0;
}

#messageInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#sendBtn {
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: 600;
    min-width: 100px;
    width: auto;
    flex: 0 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        padding: 30px 15px;
    }

    .input-group {
        flex-direction: column;
        gap: 15px;
    }

    input[type="number"] {
        width: 100%;
        padding: 16px;
    }

    button {
        width: 100%;
        padding: 16px;
    }

    .info {
        padding: 20px;
        margin-top: 30px;
    }

    .landing-shell {
        grid-template-columns: 1fr;
        padding: 24px 16px;
    }

    .landing-copy {
        text-align: center;
        align-items: center;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 14px;
    }

    .steps {
        flex-direction: column;
        align-items: center;
    }

    .join-panel {
        width: 100%;
    }

    .header-info {
        width: 100%;
        justify-content: center;
    }

    .messages-container {
        padding: 15px;
    }

    .message-content {
        max-width: 90%;
        padding: 12px 15px;
    }

    .message-input-container {
        padding: 15px;
        flex-wrap: nowrap;
    }

    #messageInput {
        min-height: 50px;
    }

    #sendBtn {
        min-width: 80px;
        padding: 12px 20px;
        width: auto;
    }

    /* Mobile chat improvements */
    .chat-container {
        padding-top: env(safe-area-inset-top);
    }

    .chat-header {
        position: sticky;
        top: env(safe-area-inset-top);
        z-index: 5;
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: nowrap;
        min-height: 48px;
        background: inherit;
    }

    .header-left {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        align-items: flex-start;
        text-align: left;
    }

    .header-line {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px 8px;
    }

    .header-actions {
        width: auto;
        flex: 0 0 auto;
        justify-content: flex-end;
        gap: 6px;
    }

    #onlineCount {
        padding: 4px 8px;
    }

    .leave-btn,
    .next-btn,
    .menu-btn {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 12px;
    }

    .chat-tools {
        position: sticky;
        top: calc(56px + env(safe-area-inset-top));
        z-index: 4;
        padding: 4px 8px;
        gap: 4px;
        flex-direction: column;
        align-items: stretch;
    }

    .menu-btn,
    .menu-backdrop,
    .menu-panel {
        display: block;
    }

    .online-users {
        display: none;
    }

    .search-group {
        max-width: none;
        width: 100%;
        height: 32px;
    }

    #searchInput {
        font-size: 14px;
        height: 32px;
        padding: 4px 10px;
    }

    #clearSearchBtn,
    #changeNameBtnDesktop {
        min-height: 32px;
        width: 100%;
    }

    #changeNameBtnDesktop {
        display: none;
    }

    .online-users {
        padding: 8px 10px;
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .online-user {
        white-space: nowrap;
        font-size: 12px;
        padding: 4px 8px;
    }

    .message-row {
        gap: 8px;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .message-content {
        max-width: 88%;
        border-radius: 18px;
    }

    .message-actions {
        gap: 6px;
        flex-wrap: wrap;
    }

    .message-btn {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 36px;
    }

    .inline-editor {
        max-width: 100%;
    }

    .message-input-container {
        position: sticky;
        bottom: 0;
        z-index: 6;
        padding: 10px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        background: #ffffff;
        gap: 8px;
    }

    #messageInput {
        min-height: 44px;
        border-radius: 18px;
    }

    #sendBtn {
        min-height: 44px;
        border-radius: 18px;
    }

    #sendBtn {
        width: auto;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 20px 12px;
    }

    h1 {
        font-size: 24px;
    }

    p {
        font-size: 15px;
        margin-bottom: 30px;
    }

    .input-group {
        margin: 30px 0;
    }

    .info {
        margin-top: 25px;
        padding: 15px;
    }

    .hero-badge {
        font-size: 11px;
    }

    .feature-card {
        border-radius: 14px;
    }

    .info li {
        font-size: 14px;
        padding-left: 25px;
        margin-bottom: 10px;
    }

    .info li:before {
        font-size: 16px;
    }

    .chat-header h2 {
        font-size: 16px;
    }

    #onlineCount,
    .leave-btn {
        font-size: 14px;
        padding: 6px 12px;
    }

    .message-content {
        max-width: 95%;
        padding: 10px 12px;
    }

    .message-time {
        font-size: 11px;
    }

    .system-text {
        font-size: 13px;
        padding: 8px 15px;
    }

    #messageInput {
        font-size: 15px;
        padding: 12px 15px;
    }

    #sendBtn {
        font-size: 15px;
        padding: 12px 15px;
    }

    .chat-header {
        padding: 10px 10px;
    }

    .user-badge {
        padding: 4px 8px;
        font-size: 12px;
    }

    .message-content {
        max-width: 94%;
    }

    .message-btn {
        padding: 7px 10px;
        font-size: 11px;
    }

    .chat-tools {
        top: 58px;
    }

    #searchInput {
        font-size: 14px;
    }

    .message-text {
        font-size: 14px;
    }
}

/* Tablet Landscape */

/* Large Desktop */
@media (min-width: 1200px) {
    .card {
        max-width: 800px;
        padding: 60px 50px;
    }

    .info {
        max-width: 700px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .card {
        padding: 15px 10px;
    }

    h1 {
        font-size: 22px;
    }

    p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .input-group {
        margin: 20px 0;
    }

    .info {
        padding: 12px;
    }

    .info li {
        font-size: 13px;
        padding-left: 20px;
    }

    .message-content {
        padding: 8px 10px;
    }
}

/* Orientation handling */
@media (orientation: landscape) and (max-height: 600px) {
    .card {
        padding: 20px;
        justify-content: flex-start;
        overflow-y: auto;
    }

    .chat-container {
        height: 100vh;
    }

    .messages-container {
        padding: 10px;
    }

    .message-content {
        max-width: 80%;
        padding: 10px 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .screen {
        background: #1a1a1a;
    }

    h1 {
        color: #ffffff;
    }

    p {
        color: #cccccc;
    }

    input[type="number"] {
        background: #2a2a2a;
        border-color: #444;
        color: #ffffff;
    }

    input[type="number"]:focus {
        border-color: #667eea;
    }

    .info {
        background: #2a2a2a;
    }

    .info h3 {
        color: #ffffff;
    }

    .info li {
        color: #cccccc;
    }

    .messages-container {
        background: #1a1a1a;
    }

    .other-message .message-content {
        background: #2a2a2a;
        color: #ffffff;
        border-color: #444;
    }

    .message-sender {
        color: #999;
    }

    .system-text {
        background: #2a2a2a;
        color: #999;
    }

    .message-input-container {
        background: #1a1a1a;
        border-color: #444;
    }

    #messageInput {
        background: #2a2a2a;
        border-color: #444;
        color: #ffffff;
    }

    #messageInput:focus {
        border-color: #667eea;
    }
}

/* Fix for mobile keyboards */
@media (max-height: 700px) {
    .chat-container {
        height: 100dvh;
        /* Use dynamic viewport height */
    }

    .message-input-container {
        position: sticky;
        bottom: 0;
        background: white;
        z-index: 100;
    }
}

/* Ensure proper touch targets */
#sendBtn,
.leave-btn {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent zoom on input focus on iOS */
input[type="number"],
#messageInput {
    font-size: 16px;
    /* Prevent iOS zoom */
}

/* Better scrolling on mobile */
.messages-container {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Handle keyboard appearance */
@media (max-width: 768px) {
    .chat-container {
        height: 100dvh;
    }

    .message-input-container {
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    .chat-container {
        height: -webkit-fill-available;
    }
}

/* style.css - UPDATED VERSION */
/* Add these styles to your existing CSS */

/* Share button styles */
.share-btn {
    padding: 10px 20px;
    background: rgba(76, 175, 80, 0.9);
    border: 1px solid rgba(76, 175, 80, 0.3);
    font-size: clamp(14px, 2.5vw, 16px);
    border-radius: 20px;
    transition: background-color 0.3s;
    color: white;
    font-weight: 600;
    margin-right: 10px;
}

.share-btn:hover {
    background: rgba(76, 175, 80, 1);
    transform: translateY(-2px);
}

.leave-btn {
    padding: 10px 20px;
    background: rgba(244, 67, 54, 0.9);
    border: 1px solid rgba(244, 67, 54, 0.3);
    font-size: clamp(14px, 2.5vw, 16px);
    border-radius: 20px;
    transition: background-color 0.3s;
    color: white;
    font-weight: 600;
}

.leave-btn:hover {
    background: rgba(244, 67, 54, 1);
    transform: translateY(-2px);
}

/* Update header-info spacing */
.header-info {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 15px);
}

/* Adjust for mobile */
@media (max-width: 768px) {
    .chat-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .header-info {
        width: 100%;
        justify-content: space-between;
    }

    .share-btn,
    .leave-btn {
        flex: 1;
        margin-right: 0;
        text-align: center;
    }
}

@media (max-width: 480px) {

    .share-btn,
    .leave-btn {
        padding: 8px 15px;
        font-size: 14px;
        min-width: auto;
    }
}

/* Dark mode support for new buttons */
@media (prefers-color-scheme: dark) {
    .share-btn {
        background: rgba(76, 175, 80, 0.7);
    }

    .leave-btn {
        background: rgba(244, 67, 54, 0.7);
    }

    .share-btn:hover {
        background: rgba(76, 175, 80, 0.9);
    }

    .leave-btn:hover {
        background: rgba(244, 67, 54, 0.9);
    }
}

/* Add to your existing style.css */

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    max-width: 300px;
    font-weight: 500;
}

.notification.error {
    background: #f44336;
}

.notification.info {
    background: #2196F3;
}

@keyframes slideIn {
}

@keyframes fadeOut {
}

/* Update share button to be more prominent */
.share-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
    font-size: clamp(14px, 2.5vw, 16px);
    border-radius: 20px;
    transition: all 0.3s;
    color: white;
    font-weight: 600;
    margin-right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.share-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.share-btn:active {
    transform: translateY(0);
}

/* Leave button update */
.leave-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border: none;
    font-size: clamp(14px, 2.5vw, 16px);
    border-radius: 20px;
    transition: all 0.3s;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.leave-btn:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.leave-btn:active {
    transform: translateY(0);
}

/* Online count update */
#onlineCount {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: clamp(14px, 2.5vw, 16px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Update info section in channel screen */
.info ul li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info ul li:before {
    content: "\2713";
    color: #4CAF50;
    font-size: 18px;
    flex-shrink: 0;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    color: #666;
}

/* Update for dark mode */
@media (prefers-color-scheme: dark) {
    .notification {
        background: #2e7d32;
        color: white;
    }

    .notification.error {
        background: #c62828;
    }

    .notification.info {
        background: #1565c0;
    }

    .share-btn {
        background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    }

    .leave-btn {
        background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    }

    #onlineCount {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Add these animations to your style.css */

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Modal styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Update loading state animation */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading p {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.loading p::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Add these styles to your existing style.css */

/* Share button styles */
.share-btn {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.share-btn:hover {
    background: #45a049;
}

/* Update header-info to accommodate new button */
.header-info {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 15px);
}

/* Ensure online count looks good */
#onlineCount {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: clamp(14px, 2.5vw, 16px);
}

/* Update leave button for consistency */
.leave-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: clamp(14px, 2.5vw, 16px);
    border-radius: 20px;
    transition: background-color 0.3s;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.leave-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        text-align: center;
    }

    .header-info {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .share-btn,
    .leave-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    #onlineCount {
        font-size: 14px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {

    .share-btn,
    .leave-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    #onlineCount {
        font-size: 13px;
        padding: 5px 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .share-btn {
        background: #2e7d32;
    }

    .share-btn:hover {
        background: #1b5e20;
    }
}

/* New UI enhancements */
.input-stack {
    flex-direction: column;
}

#nameInput {
    padding: 18px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: clamp(16px, 3vw, 18px);
    outline: none;
    transition: border-color 0.3s;
}

#nameInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.header-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}

.header-line h2 {
    white-space: nowrap;
}

.online-badge,
.user-badge {
    white-space: nowrap;
}

.user-name {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.user-badge {
    font-size: clamp(11px, 2.4vw, 13px);
    background: rgba(255, 255, 255, 0.18);
    padding: 4px 10px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.online-badge {
    font-size: clamp(11px, 2.4vw, 13px);
    background: rgba(255, 255, 255, 0.18);
    padding: 4px 10px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 8px 14px;
    background: #f0f3f7;
    border-bottom: 1px solid #e1e5e9;
}

#changeNameBtnDesktop {
    padding: 8px 14px;
    min-width: auto;
    border-radius: 18px;
    font-size: 13px;
    background: #2f3640;
}

#changeNameBtnDesktop:hover {
    background: #1f252c;
}

.search-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 520px;
    height: 36px;
}

#searchInput {
    flex: 1;
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid #d7dbe0;
    font-size: 14px;
    outline: none;
    background: white;
    height: 36px;
}

#clearSearchBtn {
    padding: 6px 12px;
    min-width: auto;
    border-radius: 16px;
    font-size: 14px;
    background: #667eea;
    height: 36px;
}

.typing-indicator {
    font-size: 14px;
    color: #555;
    min-height: 18px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator::after {
    content: "...";
    display: inline-block;
    width: 0ch;
    overflow: hidden;
    animation: typing-dots 1.2s steps(4, end) infinite;
}

.typing-indicator:empty::after {
    content: "";
    animation: none;
}

@keyframes typing-dots {
    to {
        width: 3ch;
    }
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#changeNameBtn {
    padding: 8px 14px;
    min-width: auto;
    border-radius: 18px;
    font-size: 13px;
    background: #2f3640;
}

#changeNameBtn:hover {
    background: #1f252c;
}

.online-users {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e1e5e9;
}

.online-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 18px;
    background: #f5f7fa;
    color: #333;
    font-size: 14px;
}

.online-user.self {
    background: #e8ecff;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.online-user .avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.online-user .name {
    font-weight: 600;
}

.empty-online {
    color: #777;
    font-size: 14px;
}

.message.hidden {
    display: none;
}

@media (max-width: 768px) {
    .chat-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .typing-indicator {
        text-align: left;
    }
}

@media (prefers-color-scheme: dark) {

    #nameInput,
    #searchInput {
        background: #2a2a2a;
        border-color: #444;
        color: #ffffff;
    }

    #changeNameBtn {
        background: #3b3f4a;
        color: #f0f0f0;
    }

    #changeNameBtn:hover {
        background: #2b2f38;
    }

    #changeNameBtnDesktop {
        background: #3b3f4a;
        color: #f0f0f0;
    }

    .chat-tools {
        background: #1f1f1f;
        border-color: #333;
    }

    .online-users {
        background: #1a1a1a;
        border-color: #333;
    }

    .online-user {
        background: #2a2a2a;
        color: #f0f0f0;
    }

    .online-user.self {
        background: #2a2f55;
        border-color: rgba(102, 126, 234, 0.5);
    }

    .typing-indicator,
    .empty-online {
        color: #bbb;
    }

    .message-avatar {
        background: #4c5fd6;
    }

    .message-btn {
        background: rgba(255, 255, 255, 0.12);
        color: #f0f0f0;
    }

    .message-btn.danger {
        background: rgba(244, 67, 54, 0.2);
        color: #ffb0a8;
    }

    .inline-editor {
        background: #2a2a2a;
        border-color: #444;
        box-shadow: none;
    }

    .inline-editor textarea {
        background: #1f1f1f;
        border-color: #444;
        color: #f0f0f0;
    }

    .editor-btn.cancel {
        background: #6b6b6b;
    }

    .menu-panel {
        background: #1a1a1a;
        color: #f0f0f0;
    }

    .menu-header {
        border-color: #2a2a2a;
    }

    .menu-section {
        border-color: #2a2a2a;
    }

    .menu-item {
        background: #2a2a2a;
        color: #f0f0f0;
    }

    .menu-label,
    .menu-online {
        color: #bdbdbd;
    }

    .modal-content {
        background: #1f1f1f;
        color: #f0f0f0;
    }

    .modal-content p {
        color: #c5c5c5;
    }

    .modal-content input {
        background: #121212;
        border-color: #333;
        color: #f0f0f0;
    }

    .hero-badge {
        background: rgba(102, 126, 234, 0.2);
        color: #c9d2ff;
    }

    .feature-card {
        background: #20243a;
        box-shadow: none;
    }

    .feature-title {
        color: #e5e9ff;
    }

    .feature-text {
        color: #b9c0d6;
    }

    .step {
        background: rgba(102, 126, 234, 0.18);
        color: #c9d2ff;
    }

    .landing-screen {
        background: radial-gradient(circle at top left, #1e2238 0%, #141622 60%, #0f111b 100%);
    }

    .landing-copy p {
        color: #c5cada;
    }

    .join-panel {
        background: #1b1f32;
        box-shadow: none;
    }

    .join-header p {
        color: #b3b8c9;
    }

    .field {
        color: #d8def1;
    }

    .field input {
        background: #111423;
        border-color: #2b3150;
        color: #f0f0f0;
    }

    .join-note {
        background: #222845;
        color: #c1c7da;
    }
}

/* Compact chat header overrides */
.chat-header {
    padding: 10px 16px;
    min-height: 56px;
}

.chat-header h2 {
    font-size: clamp(16px, 3.2vw, 20px);
}

.header-actions {
    gap: 8px;
}

.online-badge,
.user-badge {
    font-size: clamp(11px, 2.4vw, 13px);
    padding: 4px 10px;
    border-radius: 14px;
}

.leave-btn,
.next-btn {
    padding: 8px 16px;
    font-size: clamp(12px, 2.2vw, 14px);
    border-radius: 18px;
}

.menu-btn {
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .chat-header {
        padding: 8px 12px;
        min-height: 52px;
    }

    .online-badge,
    .user-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .leave-btn,
    .next-btn {
        padding: 7px 12px;
        font-size: 12px;
    }

    .menu-btn {
        padding: 6px 10px;
    }
}

/* Help modal list */
.help-list {
    margin: 10px 0 0 0;
    padding-left: 18px;
    color: #555;
    line-height: 1.5;
    font-size: 14px;
}

/* Theme overrides */
body.theme-dark {
    color-scheme: dark;
}

body.theme-dark .screen {
    background: #1a1a1a;
}

body.theme-dark .chat-tools,
body.theme-dark .message-input-container {
    background: #1a1a1a;
    border-color: #333;
}

body.theme-dark .messages-container {
    background: #1a1a1a;
}

body.theme-dark #messageInput,
body.theme-dark #searchInput,
body.theme-dark #nameInput,
body.theme-dark .field input {
    background: #2a2a2a;
    border-color: #444;
    color: #ffffff;
}

body.theme-dark .other-message .message-content {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #444;
}

body.theme-dark .menu-panel {
    background: #1a1a1a;
    color: #f0f0f0;
}

body.theme-dark .menu-item {
    background: #2a2a2a;
    color: #f0f0f0;
}

body.theme-dark .help-list {
    color: #c5c5c5;
}

body.theme-light {
    color-scheme: light;
}

body.theme-light .screen {
    background: #ffffff;
}

body.theme-light .messages-container {
    background: #f5f7fa;
}

/* Hamburger visibility fixes */
.header-left {
    flex: 1;
    min-width: 0;
}

.header-actions {
    flex-shrink: 0;
}

.header-line {
    max-width: 100%;
}

.menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-backdrop,
.menu-panel {
    display: block;
}

/* Hamburger icon */
.menu-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
}

.menu-icon::before,
.menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
}

.menu-icon::before {
    top: -6px;
}

.menu-icon::after {
    top: 6px;
}

/* Hamburger button refinements */
.menu-btn {
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 20px;
    \r\n line-height: 1;
    box-shadow: none;
}

.menu-btn:hover {
    transform: none;
    box-shadow: none;
}

/* Hide online list in main view (show only in menu) */
.online-users {
    display: none !important;
}

/* Menu links */
.menu-link {
    text-decoration: none;
    display: block;
}

/* Page layout */
.page-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(24px, 4vw, 48px) clamp(18px, 4vw, 36px) 64px;
    background: linear-gradient(180deg, #f7f9ff 0%, #ffffff 60%, #f2f4ff 100%);
}

.page-card {
    background: #ffffff;
    width: min(980px, 94vw);
    border-radius: 24px;
    padding: clamp(22px, 3vw, 32px);
    border: 1px solid rgba(94, 101, 140, 0.12);
    box-shadow: 0 18px 48px rgba(40, 54, 120, 0.12);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-header h1 {
    margin: 0 0 6px 0;
    font-size: clamp(1.8rem, 2.6vw, 2.4rem);
}

.page-header p {
    margin: 0;
    color: #6a728c;
}

.page-back {
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 999px;
    background: transparent;
    color: #3b4dd1;
    font-weight: 600;
    border: 1px solid rgba(59, 77, 209, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.page-content {
    color: #4d5675;
    line-height: 1.6;
    font-size: 1rem;
}

.page-list {
    padding-left: 18px;
    margin: 0;
}

.page-meta {
    font-size: 0.9rem;
    color: #7b83a3;
}

.page-divider {
    height: 1px;
    background: rgba(110, 120, 160, 0.18);
    margin: 22px 0;
}

.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.page-section {
    background: #f8f9ff;
    border-radius: 18px;
    padding: 18px;
    border: 1px solid rgba(94, 101, 140, 0.15);
}

.page-section h2,
.page-section h3 {
    margin-top: 0;
}

.page-card-mini {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(94, 101, 140, 0.2);
}

.page-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.12);
    color: #4b57aa;
    font-size: 0.85rem;
    font-weight: 600;
}

.page-highlight {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(45, 212, 191, 0.12));
    border-radius: 18px;
    padding: 18px;
    border: 1px solid rgba(94, 101, 140, 0.2);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.page-actions a {
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 999px;
    background: #0ea5a4;
    color: #ffffff;
    font-weight: 600;
}

.page-actions a.secondary {
    background: transparent;
    color: #4d5675;
    border: 1px solid rgba(94, 101, 140, 0.25);
}

.page-inline-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.95rem;
}

.page-inline-links a {
    color: #5b67c7;
    text-decoration: none;
    font-weight: 600;
}

.page-details {
    border-radius: 16px;
    border: 1px solid rgba(94, 101, 140, 0.2);
    padding: 12px 16px;
    background: #ffffff;
}

.page-details + .page-details {
    margin-top: 12px;
}

.page-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #2f3a6d;
    list-style: none;
}

.page-details summary::-webkit-details-marker {
    display: none;
}

.page-details summary:after {
    content: "+";
    float: right;
    color: #667eea;
    font-weight: 700;
}

.page-details[open] summary:after {
    content: "-";
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-back {
        width: 100%;
        justify-content: center;
    }
}

body.theme-dark .page-screen {
    background: radial-gradient(circle at 10% 10%, rgba(45, 212, 191, 0.12), transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.18), transparent 45%),
        linear-gradient(180deg, #0a0f1e 0%, #0f172a 100%);
}

body.theme-dark .page-card {
    background: rgba(17, 24, 39, 0.85);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 50px rgba(5, 8, 20, 0.4);
}

body.theme-dark .page-content,
body.theme-dark .page-header p {
    color: #c5cada;
}

body.theme-dark .page-meta {
    color: #9aa2c2;
}

body.theme-dark .page-divider {
    background: rgba(148, 158, 190, 0.2);
}

body.theme-dark .page-section {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(148, 163, 184, 0.2);
}

body.theme-dark .page-card-mini,
body.theme-dark .page-details {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.24);
}

body.theme-dark .page-pill {
    background: rgba(45, 212, 191, 0.18);
    color: #b6fff2;
}

body.theme-dark .page-highlight {
    background: linear-gradient(135deg, rgba(27, 110, 243, 0.22), rgba(45, 212, 191, 0.14));
    border-color: rgba(45, 212, 191, 0.25);
}

body.theme-dark .page-actions a.secondary {
    color: #c5cada;
    border-color: rgba(148, 158, 190, 0.35);
}

body.theme-dark .page-inline-links a {
    color: #8aa4ff;
}

body.theme-dark .page-details summary {
    color: #e2e6f6;
}

body.theme-dark .page-back {
    color: #c7d2fe;
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.6);
}

/* About page - calm, scan-first layout */
.about-body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #0b0f1a;
    color: #e5e7eb;
}

.about-html,
.about-body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
}

.about-body {
    display: block;
}

.about-shell {
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 32px) 72px;
}

.about-hero {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 0 28px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    position: relative;
}

.about-eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: #9ca3af;
    margin: 0 0 8px 0;
}

.about-hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin: 0 0 10px 0;
    color: #f9fafb;
}

.about-lede {
    max-width: 60ch;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #cbd5f0;
    margin: 0;
}

.about-hero-actions,
.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.about-primary,
.about-secondary {
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.about-primary {
    background: #22c55e;
    color: #0b1020;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.25);
}

.about-secondary {
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: transparent;
}

.about-content {
    margin-top: 28px;
    display: grid;
    gap: 24px;
}

.about-section {
    padding: 18px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.about-section h2 {
    margin: 0 0 12px 0;
    font-size: 1.3rem;
    color: #f3f4f6;
}

.about-steps {
    display: grid;
    gap: 14px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.about-steps li {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(148, 163, 184, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.step-title {
    display: block;
    font-weight: 600;
    color: #f9fafb;
}

.step-text {
    display: block;
    color: #cbd5f0;
    margin-top: 4px;
}

.about-highlight {
    background: rgba(34, 197, 94, 0.08);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.about-disclosure {
    margin-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 12px;
}

.about-disclosure summary {
    cursor: pointer;
    color: #e5e7eb;
    font-weight: 600;
    list-style: none;
}

.about-disclosure summary::-webkit-details-marker {
    display: none;
}

.about-disclosure summary:after {
    content: "+";
    float: right;
    color: #22c55e;
}

.about-disclosure[open] summary:after {
    content: "-";
}

.about-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.about-list h3 {
    margin: 0 0 6px 0;
    color: #f3f4f6;
}

.about-list p {
    margin: 0;
    color: #cbd5f0;
}

.about-footer {
    border-bottom: none;
    padding-bottom: 0;
}

.about-actions {
    margin-top: 12px;
}

.about-primary:focus-visible,
.about-secondary:focus-visible,
.about-disclosure summary:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

@media (hover: hover) {
    .about-primary:hover,
    .about-secondary:hover {
        transform: translateY(-1px);
    }

    .about-secondary:hover {
        border-color: rgba(34, 197, 94, 0.5);
    }
}

@media (max-width: 720px) {
    .about-shell {
        padding-bottom: 56px;
    }

    .about-hero {
        gap: 14px;
    }
}

body.theme-dark .menu-user {
    background: rgba(15, 23, 42, 0.5);
    color: #e2e8f0;
}

body.theme-dark .menu-user.self {
    border-color: rgba(45, 212, 191, 0.4);
    background: rgba(45, 212, 191, 0.12);
}

body.theme-dark .join-panel {
    background: #1b1f32;
    border-color: rgba(102, 126, 234, 0.2);
}

body.theme-dark .join-form {
    background: #202540;
}

body.theme-dark .field-hint {
    color: #a4aac0;
}

body.theme-dark .join-note {
    background: #232845;
    color: #b9bfd6;
}

/* Help page full-screen layout */
.help-body .help-screen {
    min-height: 100vh;
    padding: clamp(18px, 3vw, 32px);
    align-items: stretch;
    background:
        radial-gradient(circle at 10% 10%, rgba(45, 212, 191, 0.18), transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.2), transparent 45%),
        radial-gradient(circle at 20% 90%, rgba(34, 197, 94, 0.18), transparent 45%),
        linear-gradient(180deg, #0a1024 0%, #0f172a 100%);
}

.help-body .help-screen {
    align-items: flex-start;
    padding: clamp(28px, 4vw, 48px);
}

.help-body .help-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: clamp(18px, 2.6vw, 28px);
    border-radius: 26px;
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.65));
    border: 1px solid rgba(148, 163, 184, 0.18);
    margin-bottom: clamp(20px, 3vw, 32px);
    width: min(1080px, 100%);
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(12px);
}

.help-body .help-kicker {
    display: inline-flex;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.6);
    color: #a7f3d0;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.help-body .help-hero h1 {
    margin: 10px 0 6px;
    font-size: clamp(2rem, 4vw, 2.6rem);
    color: #f8fafc;
}

.help-body .help-hero p {
    margin: 0;
    color: #d1d5f0;
    max-width: 540px;
}

.help-body .help-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: clamp(16px, 3vw, 28px);
    width: min(1080px, 100%);
    margin: 0 auto;
}

.help-body .help-panel {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.7));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    padding: clamp(16px, 2.4vw, 24px);
    color: #e2e8f0;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(10px);
}

.help-body .help-panel h2 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #f8fafc;
}

.help-body .help-steps {
    display: grid;
    gap: 14px;
}

.help-body .help-step {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.help-body .help-step:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 212, 191, 0.35);
}

.help-body .help-step h3 {
    margin: 0 0 4px 0;
    color: #f8fafc;
    font-size: 1rem;
}

.help-body .help-step p {
    margin: 0;
    color: #cbd5f0;
}

.help-body .step-index {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(45, 212, 191, 0.2);
    color: #a7f3d0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.help-body .help-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-body .help-mail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #22c55e, #14b8a6);
    color: #0b1020;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.3);
}

.help-body .help-note {
    color: #94a3b8;
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    .help-body .help-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .help-body .help-grid {
        grid-template-columns: 1fr;
    }

    .help-body .help-screen {
        padding: 16px;
    }

    .help-body .help-hero {
        padding: 16px;
        border-radius: 18px;
    }

    .help-body .help-hero h1 {
        font-size: 1.8rem;
    }

    .help-body .help-panel {
        padding: 16px;
        border-radius: 18px;
    }

    .help-body .help-step {
        padding: 12px;
    }

    .help-body .step-index {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        font-size: 0.9rem;
    }

    .help-body .help-mail {
        width: 100%;
        justify-content: center;
    }
}

body.theme-dark .join-error {
    background: rgba(244, 67, 54, 0.2);
    color: #ffb0a8;
}

/* Landing small screen fixes */
@media (max-width: 768px) {
    .landing-shell {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px 14px;
    }

    .landing-copy {
        align-items: flex-start;
        text-align: left;
        gap: 12px;
    }

    .hero-badge {
        font-size: 10px;
        padding: 4px 10px;
    }

    .landing-copy h1 {
        font-size: 28px;
    }

    .landing-copy p {
        font-size: 14px;
    }

    .feature-grid,
    .steps {
        display: none;
    }

    .join-panel {
        padding: 20px;
        border-radius: 18px;
    }

    .join-header h2 {
        font-size: 18px;
    }

    .field input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .join-form #joinBtn {
        padding: 12px 16px;
        border-radius: 12px;
    }

    .join-note {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .landing-shell {
        padding: 16px 12px;
    }

    .join-panel {
        padding: 18px;
    }
}

/* Small screen search compact */
@media (max-width: 480px) {
    .search-group {
        height: 50px;
    }

    #searchInput {
        height: 30px;
        padding: 4px 8px;
        font-size: 13px;
    }

    #clearSearchBtn {
        min-height: 30px;
        padding: 4px 10px;
        font-size: 12px;
    }
}

/* Small screen chat-tools compact */
@media (max-width: 480px) {
    .chat-tools {
        padding: 2px 6px;
        gap: 2px;
    }
}

/* Landing redesign */
:root {
    --landing-ink: #0f172a;
    --landing-muted: #4b5563;
    --landing-accent: #0f766e;
    --landing-accent-2: #0ea5a4;
    --landing-surface: #ffffff;
    --landing-surface-2: #f6fbf9;
    --landing-stroke: #e5e7eb;
    --landing-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

body {
    font-family: "Plus Jakarta Sans", sans-serif;
}

.landing-html,
.landing-html body {
    height: auto;
    overflow: auto;
}

.landing-body {
    height: auto;
    overflow: auto;
}

.landing-body .container {
    height: auto;
    min-height: 100vh;
}

.landing-body .landing-screen {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

.landing-screen {
    background: radial-gradient(circle at top left, #f1fbf7 0%, #ffffff 50%, #f2f5ff 100%);
}

.landing-copy h1,
.join-header h2 {
    font-family: "Sora", sans-serif;
    color: var(--landing-ink);
    color: green;
}

.landing-copy p {
    color: var(--landing-muted);
}

.hero-badge {
    background: rgba(14, 165, 164, 0.12);
    color: var(--landing-accent);
}

.feature-card {
    background: var(--landing-surface);
    border: 1px solid var(--landing-stroke);
    box-shadow: var(--landing-shadow);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e8f7f3;
    color: var(--landing-accent);
    font-size: 11px;
}

.join-panel {
    background: var(--landing-surface);
    border: 1px solid rgba(15, 118, 110, 0.15);
    box-shadow: var(--landing-shadow);
}

.join-form {
    background: var(--landing-surface-2);
}

.join-form #joinBtn {
    background: linear-gradient(135deg, var(--landing-accent-2) 0%, var(--landing-accent) 100%);
    box-shadow: 0 12px 28px rgba(14, 165, 164, 0.25);
}

.join-note {
    background: #eefbf7;
}

@media (max-width: 768px) {
    .landing-shell {
        padding: 28px 16px;
    }

    .feature-card {
        box-shadow: none;
    }
}

body.theme-dark .landing-screen {
    background: radial-gradient(circle at top left, #0f172a 0%, #0b1120 60%, #080c17 100%);
}

body.theme-dark .landing-copy p {
    color: #cbd5f5;
}

body.theme-dark .feature-card {
    background: #121a2f;
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: none;
}

body.theme-dark .feature-icon {
    background: rgba(14, 165, 164, 0.2);
    color: #b5fff4;
}

body.theme-dark .join-panel {
    background: #111827;
}

body.theme-dark .join-form {
    background: #0f172a;
}

body.theme-dark .join-note {
    background: rgba(14, 165, 164, 0.15);
    color: #c7f9f2;
}

/* Professional landing */
.landing-screen {
    padding: 28px 0 40px;
}

.landing-nav {
    width: min(1100px, 92vw);
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #0f172a;
}

.brand-name {
    font-family: "Sora", sans-serif;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.15);
}

.landing-links {
    display: inline-flex;
    gap: 18px;
    font-size: 14px;
}

.landing-links a {
    text-decoration: none;
    color: #334155;
    font-weight: 600;
}

.landing-links .theme-toggle-btn {
    border: 1px solid rgba(79, 110, 247, 0.3);
    background: #eef2ff;
    color: #3b4bd7;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    min-width: auto;
}

.landing-links .theme-toggle-btn:hover {
    background: #e3e9ff;
}

.landing-footer {
    width: min(1100px, 92vw);
    margin: 24px auto 0;
    text-align: center;
    color: #6a728c;
    font-size: 13px;
}

.landing-footer p {
    margin: 0;
    display: block;
    padding: 12px 16px;
    border-radius: 14px;
    background: #f3f6ff;
    color: #42506b;
    font-weight: 500;
    border: 1px solid #e3e7f5;
}

.landing-shell {
    align-items: flex-start;
}

.landing-copy h1 {
    font-size: clamp(34px, 4.4vw, 52px);
    line-height: 1.05;
}

.landing-copy p {
    font-size: 16px;
}

.feature-card {
    border-radius: 18px;
}

.feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #e8f7f3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.steps {
    gap: 10px;
}

.step {
    background: #ecfdf5;
    color: #0f766e;
}

.step-num {
    background: #0f766e;
}

.join-panel {
    border-radius: 22px;
}

.join-header h2 {
    font-size: 20px;
}

@media (max-width: 900px) {
    .landing-shell {
        grid-template-columns: 1fr;
    }

    .landing-copy {
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .landing-nav {
        margin-bottom: 18px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .landing-links {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-end;
    }

    .landing-copy {
        display: none;
    }

    .join-panel {
        width: min(420px, 92vw);
        margin: 0 auto;
    }
}

body.theme-dark .brand {
    color: #e2e8f0;
}

body.theme-dark .landing-links a {
    color: #cbd5f5;
}

body.theme-dark .landing-links .theme-toggle-btn {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.32);
    color: #e2e8f0;
}

body.theme-dark .feature-icon {
    background: rgba(14, 165, 164, 0.2);
}

body.theme-dark .step {
    background: rgba(14, 165, 164, 0.2);
    color: #b5fff4;
}

body.theme-dark .step-num {
    background: #0ea5a4;
}

body.theme-dark .landing-footer p {
    background: #141a2b;
    border-color: #273153;
    color: #c2c9dd;
}

/* Landing mobile overhaul */
@media (max-width: 768px) {
    .landing-screen {
        padding: 16px 0 24px;
    }

    .landing-nav {
        width: min(520px, 92vw);
        margin: 0 auto 12px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .landing-shell {
        width: min(520px, 92vw);
        padding: 0 12px;
        gap: 12px;
    }

    .landing-copy {
        display: none;
    }

    .join-panel {
        width: 100%;
        margin: 0 auto;
        padding: 18px;
        border-radius: 18px;
    }

    .join-form {
        padding: 12px;
        gap: 10px;
    }

    .join-note {
        text-align: left;
    }

    .landing-footer {
        width: min(520px, 92vw);
        margin: 16px auto 0;
        text-align: left;
    }

    .landing-footer p {
        padding: 10px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .landing-nav {
        margin-bottom: 10px;
    }

    .join-panel {
        padding: 16px;
        border-radius: 16px;
    }

    .join-form {
        padding: 10px;
    }

    .field input {
        padding: 12px 12px;
        font-size: 14px;
    }

    .join-form #joinBtn {
        padding: 12px 14px;
    }
}

/* Chat redesign */
.chat-body {
    background: #f5f7fb;
}

.chat-body .screen {
    background: transparent;
}

.chat-body .chat-container {
    background: transparent;
}

.chat-body .chat-header {
    background: linear-gradient(135deg, #0f766e 0%, #0ea5a4 50%, #1d4ed8 100%);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.chat-body .header-line h2 {
    color: #f8fafc;
}

.chat-body .online-badge,
.chat-body .user-badge {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #f8fafc;
}

.chat-body .chat-tools {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-color: #e2e8f0;
}

.chat-body .online-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(14, 165, 164, 0.12);
    color: #0f766e;
    font-weight: 600;
    font-size: 0.9rem;
}

.chat-body .search-group {
    max-width: 440px;
}

.chat-body #searchInput {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.chat-body #clearSearchBtn {
    background: #0ea5a4;
}

.chat-body .messages-container {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.chat-body .message-content {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.chat-body .own-message .message-content {
    background: linear-gradient(135deg, #0ea5a4 0%, #0f766e 100%);
}

.chat-body .message-avatar {
    background: #0ea5a4;
}

.chat-body .message-input-container {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -12px 24px rgba(15, 23, 42, 0.08);
}

.chat-body .command-suggestions {
    display: none;
    margin: 0 0 10px 0;
    padding: 8px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.chat-body .command-suggestions.show {
    display: block;
}

.chat-body .command-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    color: #0f172a;
    font-weight: 600;
}

.chat-body .command-item + .command-item {
    margin-top: 6px;
}

.chat-body .command-item span {
    font-size: 0.86rem;
    color: #64748b;
    font-weight: 500;
}

.chat-body .command-item:hover,
.chat-body .command-item.active {
    background: rgba(14, 165, 164, 0.15);
}

.chat-body #messageInput {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.chat-body #sendBtn {
    background: linear-gradient(135deg, #0ea5a4 0%, #0f766e 100%);
    min-width: 92px;
}

.chat-body .menu-panel {
    background: #ffffff;
}

.chat-body.theme-dark {
    background: #0b1120;
}

.chat-body.theme-dark .chat-header {
    background: linear-gradient(135deg, #0f766e 0%, #0ea5a4 50%, #2563eb 100%);
    box-shadow: none;
}

.chat-body.theme-dark .chat-tools {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(148, 163, 184, 0.25);
}

.chat-body.theme-dark .messages-container {
    background: #0b1120;
}

.chat-body.theme-dark #messageInput,
.chat-body.theme-dark #searchInput {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}

.chat-body.theme-dark .menu-panel {
    background: #111827;
}

@media (max-width: 768px) {
    .chat-body .chat-header {
        box-shadow: none;
    }

    .chat-body .chat-tools {
        backdrop-filter: none;
    }
}

/* Landing polish v2 */
.landing-body {
    background: #f7fafc;
}

.landing-body .landing-screen {
    position: relative;
    overflow: hidden;
}

.landing-body .landing-screen::before,
.landing-body .landing-screen::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 164, 0.18) 0%, rgba(14, 165, 164, 0) 70%);
    z-index: 0;
}

.landing-body .landing-screen::before {
    top: -120px;
    right: -140px;
}

.landing-body .landing-screen::after {
    bottom: -180px;
    left: -160px;
    background: radial-gradient(circle, rgba(29, 78, 216, 0.16) 0%, rgba(29, 78, 216, 0) 70%);
}

.landing-body .landing-shell,
.landing-body .landing-nav,
.landing-body .landing-footer {
    position: relative;
    z-index: 1;
}

.landing-body .landing-shell {
    gap: 40px;
}

.landing-body .landing-copy h1 {
    max-width: 520px;
    font-size: clamp(36px, 4.6vw, 56px);
    letter-spacing: -0.5px;
}

.landing-body .landing-copy p {
    max-width: 520px;
    font-size: 16px;
}

.landing-body .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-body .feature-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-body .feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
}

.landing-body .join-panel {
    border-radius: 24px;
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.12);
}

.landing-body .join-header h2 {
    font-size: 22px;
}

.landing-body .join-form {
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.landing-body .field input {
    background: #ffffff;
}

.landing-body .join-form #joinBtn {
    font-weight: 700;
    letter-spacing: 0.2px;
}

@media (max-width: 980px) {
    .landing-body .landing-shell {
        grid-template-columns: 1fr;
    }

    .landing-body .feature-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .landing-body .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .landing-body .landing-copy {
        display: none;
    }

    .landing-body .landing-shell {
        gap: 16px;
    }

    .landing-body .join-panel {
        box-shadow: none;
    }
}

body.theme-dark.landing-body .landing-screen::before {
    background: radial-gradient(circle, rgba(14, 165, 164, 0.22) 0%, rgba(14, 165, 164, 0) 70%);
}

body.theme-dark.landing-body .landing-screen::after {
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, rgba(37, 99, 235, 0) 70%);
}

body.theme-dark.landing-body .feature-card {
    border-color: rgba(148, 163, 184, 0.2);
}

/* Typing indicator mobile */
@media (max-width: 768px) {
    .search-group .typing-indicator {
        font-size: 11px;
    }
}

/* Typing inline mobile */
.typing-inline {
    display: none;
}

@media (max-width: 768px) {
    #typingIndicator {
        display: none;
    }

    .typing-inline {
        display: inline-flex;
        align-items: center;
        font-size: 11px;
        color: #e2e8f0;
        padding: 0 4px;
    }

    .search-group {
        height: auto;
        align-items: center;
        gap: 6px;
    }

    #typingIndicatorMobile {
        min-height: 16px;
    }
}

/* Reply and reactions */
.input-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.reply-preview {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(14, 165, 164, 0.08);
    border: 1px solid rgba(14, 165, 164, 0.2);
    margin-bottom: 8px;
    position: relative;
}

.reply-info {
    font-weight: 600;
    color: #0f766e;
    font-size: 12px;
}

.reply-text {
    font-size: 12px;
    color: #475569;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-cancel {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #0f766e;
    font-size: 18px;
    min-width: auto;
    padding: 0 4px;
}

.message-reply {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 118, 110, 0.08);
    border-left: 3px solid #0f766e;
    font-size: 12px;
    color: #475569;
}

.reaction-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    font-size: 12px;
    font-weight: 600;
}

.reaction-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.reaction-btn {
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.08);
    min-width: auto;
    color: #333;
}

@media (max-width: 768px) {
    .reply-preview {
        padding: 8px 10px;
    }

    .reaction-btn {
        padding: 6px 8px;
    }
}

body.theme-dark .reply-preview {
    background: rgba(14, 165, 164, 0.18);
    border-color: rgba(14, 165, 164, 0.3);
}

body.theme-dark .reply-info {
    color: #b5fff4;
}

body.theme-dark .reply-text {
    color: #cbd5f5;
}

body.theme-dark .message-reply {
    background: rgba(14, 165, 164, 0.2);
    border-left-color: #0ea5a4;
    color: #cbd5f5;
}

body.theme-dark .reaction-pill {
    background: rgba(14, 165, 164, 0.22);
    color: #b5fff4;
}

body.theme-dark .reaction-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #f0f0f0;
}

/* Empty state */
.empty-state-chat {
    margin: 26px auto;
    max-width: 420px;
    padding: 22px 20px;
    text-align: center;
    border-radius: 16px;
    border: 1px dashed rgba(15, 118, 110, 0.25);
    background: rgba(15, 118, 110, 0.06);
    color: #64748b;
}

.empty-state-chat h3 {
    margin: 0 0 6px;
    font-size: 16px;
    color: #0f766e;
}

.empty-state-chat p {
    margin: 0;
    font-size: 13px;
}

.empty-state-chat .empty-state-btn {
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(14, 165, 164, 0.4);
    background: rgba(14, 165, 164, 0.16);
    color: #0f766e;
    font-weight: 600;
    min-width: auto;
}

.empty-state-chat .empty-state-btn:hover {
    background: rgba(14, 165, 164, 0.22);
}

body.theme-dark .empty-state-chat {
    border-color: rgba(14, 165, 164, 0.4);
    background: rgba(14, 165, 164, 0.16);
    color: #cbd5f5;
}

body.theme-dark .empty-state-chat h3 {
    color: #b5fff4;
}

body.theme-dark .empty-state-chat .empty-state-btn {
    border-color: rgba(45, 212, 191, 0.4);
    background: rgba(45, 212, 191, 0.16);
    color: #b5fff4;
}

/* Landing ad placement */
.landing-ad {
    width: min(1100px, 92vw);
    margin: 0 auto 24px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-ad .ad-slot {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (max-width: 768px) {
    .landing-ad {
        padding: 12px;
        margin-bottom: 16px;
    }
}

body.theme-dark .landing-ad {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.18);
}

/* Scroll to latest */
.scroll-latest {
    position: fixed;
    right: 20px;
    bottom: 96px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #0ea5a4;
    color: #ffffff;
    border: none;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 120;
}

.scroll-latest.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-latest .scroll-count {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
}

.scroll-latest.has-unread .scroll-count {
    display: inline-flex;
    background: #ffffff;
    color: #0f766e;
}

@media (max-width: 768px) {
    .scroll-latest {
        right: 14px;
        bottom: 84px;
        padding: 8px 12px;
    }
}

/* Chat UI upgrade */
.chat-body {
    --chat-bg: #0b1222;
    --chat-surface: #0f182d;
    --chat-panel: #131f38;
    --chat-accent: #2dd4bf;
    --chat-accent-strong: #14b8a6;
    --chat-text: #e5e7eb;
    --chat-muted: #9aa4b2;
    --chat-border: rgba(255, 255, 255, 0.08);
    background: radial-gradient(circle at top, rgba(45, 212, 191, 0.1), transparent 45%), var(--chat-bg);
    color: var(--chat-text);
}

.chat-body .chat-container {
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(8, 12, 24, 0.55);
    overflow: hidden;
}

.chat-body .chat-header {
    background: linear-gradient(135deg, #101a33 0%, #172449 100%);
    border-bottom: 1px solid var(--chat-border);
}

.chat-body .header-line h2 {
    font-weight: 700;
    color: #f8fafc;
}

.chat-body .online-badge,
.chat-body .user-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d7e0ee;
}

.chat-body .leave-btn,
.chat-body .next-btn,
.chat-body .menu-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

.chat-body .leave-btn:hover,
.chat-body .next-btn:hover,
.chat-body .menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-body .chat-tools {
    background: var(--chat-panel);
    border-bottom: 1px solid var(--chat-border);
}

.chat-body .search-group {
    background: rgba(8, 13, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 6px 10px;
}

.chat-body #searchInput {
    color: var(--chat-text);
}

.chat-body #searchInput::placeholder {
    color: var(--chat-muted);
}

.chat-body #clearSearchBtn {
    background: rgba(45, 212, 191, 0.16);
    color: #d9f7f3;
    border: 1px solid rgba(45, 212, 191, 0.28);
}

.chat-body #changeNameBtnDesktop {
    background: rgba(45, 212, 191, 0.14);
    border: 1px solid rgba(45, 212, 191, 0.3);
    color: #d9f7f3;
}

.chat-body .messages-container {
    background: var(--chat-surface);
}

.chat-body .message-content {
    background: #141f3a;
    color: var(--chat-text);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 20px rgba(5, 9, 20, 0.25);
}

.chat-body .own-message .message-content {
    background: linear-gradient(135deg, #1b6ef3 0%, #2563eb 100%);
    border-color: transparent;
    color: #ffffff;
}

.chat-body .message-avatar {
    background: var(--chat-accent);
    color: #082026;
}

.chat-body .message-sender,
.chat-body .message-time {
    color: var(--chat-muted);
}

.chat-body .message-input-container {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2), var(--chat-panel));
    border-top: 1px solid var(--chat-border);
}

.chat-body .input-row {
    background: rgba(8, 13, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.chat-body #messageInput {
    color: var(--chat-text);
}

.chat-body #messageInput::placeholder {
    color: var(--chat-muted);
}

.chat-body #sendBtn {
    background: var(--chat-accent);
    color: #041518;
    font-weight: 700;
    border-radius: 12px;
}

.chat-body #sendBtn:hover {
    background: var(--chat-accent-strong);
}

.chat-body .menu-panel {
    background: #101a33;
    border-left: 1px solid var(--chat-border);
}

.chat-body .menu-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--chat-text);
}

.chat-body .menu-item:hover {
    background: rgba(255, 255, 255, 0.14);
}

.chat-body .scroll-latest {
    background: var(--chat-accent);
    color: #041518;
}

@media (max-width: 768px) {
    .chat-body .chat-container {
        border-radius: 0;
    }

    .chat-body .chat-header {
        padding: 8px 12px;
    }
}

/* Chat UI v3 - Bold redesign */
.chat-body {
    --v3-bg: #0c0f14;
    --v3-surface: #161b22;
    --v3-panel: #1b2230;
    --v3-accent: #ff7a59;
    --v3-accent-2: #7c3aed;
    --v3-text: #f1f5f9;
    --v3-muted: #9aa4b2;
    --v3-border: rgba(255, 255, 255, 0.08);
    background: radial-gradient(circle at 20% 10%, rgba(255, 122, 89, 0.15), transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(124, 58, 237, 0.18), transparent 45%),
        var(--v3-bg);
    color: var(--v3-text);
}

.chat-body .container {
    padding: 18px;
}

.chat-body .chat-container {
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.98), rgba(22, 27, 34, 0.95));
    border: 1px solid var(--v3-border);
    border-radius: 22px;
    box-shadow: 0 30px 70px rgba(3, 6, 14, 0.6);
    overflow: hidden;
}

.chat-body .chat-header {
    background: linear-gradient(135deg, rgba(27, 34, 48, 0.95), rgba(20, 25, 38, 0.98));
    border-bottom: 1px solid var(--v3-border);
}

.chat-body .header-line h2 {
    color: var(--v3-text);
    font-size: 18px;
    letter-spacing: 0.2px;
}

.chat-body .online-badge,
.chat-body .user-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--v3-muted);
}

.chat-body .leave-btn,
.chat-body .next-btn,
.chat-body .menu-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--v3-text);
    border-radius: 14px;
}

.chat-body .leave-btn:hover,
.chat-body .next-btn:hover,
.chat-body .menu-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.chat-body .chat-tools {
    background: var(--v3-panel);
    border-bottom: 1px solid var(--v3-border);
}

.chat-body .search-group {
    background: rgba(12, 15, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 6px 10px;
}

.chat-body #clearSearchBtn {
    background: rgba(255, 122, 89, 0.18);
    color: #ffe7e1;
    border: 1px solid rgba(255, 122, 89, 0.3);
}

.chat-body #changeNameBtnDesktop {
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(124, 58, 237, 0.4);
    color: #e9ddff;
}

.chat-body .messages-container {
    background: var(--v3-surface);
}

.chat-body .message-content {
    background: #1f2633;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    color: var(--v3-text);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.chat-body .own-message .message-content {
    background: linear-gradient(135deg, #ff7a59 0%, #ffb454 100%);
    color: #1a0b07;
    border-color: transparent;
}

.chat-body .message-avatar {
    background: linear-gradient(135deg, #7c3aed 0%, #ff7a59 100%);
    color: #ffffff;
}

.chat-body .message-sender,
.chat-body .message-time {
    color: var(--v3-muted);
}

.chat-body .message-input-container {
    background: linear-gradient(180deg, rgba(27, 34, 48, 0.9), rgba(22, 27, 34, 0.98));
    border-top: 1px solid var(--v3-border);
}

.chat-body .input-row {
    background: rgba(12, 15, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.chat-body #sendBtn {
    background: linear-gradient(135deg, #ff7a59 0%, #ffb454 100%);
    color: #1a0b07;
    border-radius: 12px;
}

.chat-body #sendBtn:hover {
    filter: brightness(0.98);
}

.chat-body .menu-panel {
    background: #141a26;
    border-left: 1px solid var(--v3-border);
}

.chat-body .menu-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-body .menu-item:hover {
    background: rgba(255, 255, 255, 0.16);
}

.chat-body .scroll-latest {
    background: linear-gradient(135deg, #7c3aed 0%, #ff7a59 100%);
    color: #ffffff;
}

@media (max-width: 768px) {
    .chat-body .container {
        padding: 0;
    }
}

/* Chat UI v4 - Elegant dark */
.chat-body {
    --v4-bg: #0a0e1a;
    --v4-surface: #0f1626;
    --v4-panel: #121b2e;
    --v4-accent: #38bdf8;
    --v4-accent-soft: #22d3ee;
    --v4-text: #e6edf6;
    --v4-muted: #96a3b5;
    --v4-border: rgba(148, 163, 184, 0.18);
    background: radial-gradient(1200px 600px at 15% -10%, rgba(34, 211, 238, 0.12), transparent 60%),
        radial-gradient(900px 480px at 85% -20%, rgba(56, 189, 248, 0.14), transparent 60%),
        var(--v4-bg);
    color: var(--v4-text);
}

.chat-body .chat-container {
    background: var(--v4-surface);
    border: 1px solid var(--v4-border);
    border-radius: 22px;
    box-shadow: 0 24px 80px rgba(6, 11, 22, 0.6);
    overflow: hidden;
}

.chat-body .chat-header {
    background: linear-gradient(135deg, rgba(18, 27, 46, 0.95), rgba(14, 21, 36, 0.98));
    border-bottom: 1px solid var(--v4-border);
}

.chat-body .header-line h2 {
    color: var(--v4-text);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.chat-body .online-badge,
.chat-body .user-badge {
    background: rgba(45, 212, 191, 0.18);
    border: none;
    color: #d1fff7;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 600;
    letter-spacing: 0.1px;
    font-size: 0.85rem;
}

.chat-body .leave-btn,
.chat-body .next-btn,
.chat-body .menu-btn {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--v4-text);
    border-radius: 14px;
}

.chat-body .leave-btn:hover,
.chat-body .next-btn:hover,
.chat-body .menu-btn:hover {
    background: rgba(148, 163, 184, 0.2);
}

.chat-body .chat-tools {
    background: var(--v4-panel);
    border-bottom: 1px solid var(--v4-border);
}

.chat-body .search-group {
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
}

.chat-body #clearSearchBtn {
    background: rgba(56, 189, 248, 0.16);
    color: #d8f3ff;
    border: 1px solid rgba(56, 189, 248, 0.32);
}

.chat-body #changeNameBtnDesktop {
    background: rgba(34, 211, 238, 0.18);
    border: 1px solid rgba(34, 211, 238, 0.35);
    color: #c8f7ff;
}

.chat-body .messages-container {
    background: var(--v4-surface);
}

.chat-body .message-content {
    background: #16213a;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    color: var(--v4-text);
    box-shadow: 0 10px 24px rgba(4, 8, 18, 0.35);
}

.chat-body .own-message .message-content {
    background: linear-gradient(135deg, #2a7df5 0%, #38bdf8 100%);
    color: #07121f;
    border-color: transparent;
}

.chat-body .message-avatar {
    background: linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
    color: #04131f;
}

.chat-body .message-sender,
.chat-body .message-time {
    color: var(--v4-muted);
}

.chat-body .message-input-container {
    background: linear-gradient(180deg, rgba(18, 27, 46, 0.9), rgba(14, 21, 36, 0.98));
    border-top: 1px solid var(--v4-border);
}

.chat-body .input-row {
    background: rgba(10, 14, 26, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
}

.chat-body #sendBtn {
    background: linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
    color: #04121c;
    border-radius: 12px;
}

.chat-body #sendBtn:hover {
    filter: brightness(0.97);
}

.chat-body .menu-panel {
    background: #0f1626;
    border-left: 1px solid var(--v4-border);
}

.chat-body .menu-item {
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--v4-text);
}

.chat-body .menu-item:hover {
    background: rgba(148, 163, 184, 0.16);
}

.chat-body .scroll-latest {
    background: linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
    color: #04121c;
}

