* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #9b30ff;
    --primary-dark: #7b1fa2;
    --accent: #e040fb;
    --bg-deep: #0a0014;
    --glass-border: rgba(155, 48, 255, 0.25);
    --glass-bg: rgba(20, 5, 40, 0.65);
    --text-primary: #f0e6ff;
    --text-muted: rgba(240, 230, 255, 0.55);
    --danger: #ff4060;
    --success: #00e676;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

/* ================= BACKGROUND EFFECTS ================= */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: orbFloat 12s ease-in-out infinite;
}

.bg-orb:nth-child(1) {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-orb:nth-child(2) {
    width: 350px;
    height: 350px;
    background: var(--accent);
    bottom: -80px;
    right: -80px;
    animation-delay: -4s;
    animation-duration: 15s;
}

.bg-orb:nth-child(3) {
    width: 250px;
    height: 250px;
    background: #6a1b9a;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -8s;
    animation-duration: 18s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.02); }
}

/* ================= APP CONTAINER ================= */
.app {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 700px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    z-index: 1;
    padding: calc(20px + env(safe-area-inset-top, 20px)) 20px calc(20px + env(safe-area-inset-bottom, 20px)) 20px;
    overflow: hidden;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* ================= CHAT HEADER ================= */
.chat-header {
    padding: calc(16px + env(safe-area-inset-top, 16px)) 20px 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.chat-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header h1 span {
    color: #e040fb !important;
}

.header-lock-img {
    height: 1.4rem;
    width: auto;
    display: block;
}

.room-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.room-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); }
}

.users-count {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ================= MESSAGES AREA ================= */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 20px));
}

.messages-area::-webkit-scrollbar {
    width: 4px;
}

.messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

/* ================= MESSAGES ================= */
.msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    animation: msgIn 0.3s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg.mine {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg.other {
    align-self: flex-start;
    background: rgba(155, 48, 255, 0.12);
    border: 1px solid rgba(155, 48, 255, 0.15);
    border-bottom-left-radius: 4px;
}

.msg .nick {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
    opacity: 0.8;
}

.msg.mine .nick {
    color: rgba(255, 255, 255, 0.7);
}

.msg .time {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 3px;
    text-align: right;
}

.msg.other .time {
    color: var(--text-muted);
}

.msg-system {
    align-self: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 4px 12px;
    background: rgba(155, 48, 255, 0.06);
    border-radius: 20px;
    font-style: italic;
}

.msg-img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 8px;
    display: block;
    margin-top: 6px;
    cursor: pointer;
    object-fit: cover;
}

.msg-file-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(155, 48, 255, 0.08);
    border: 1px solid rgba(155, 48, 255, 0.2);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    margin-top: 6px;
    font-size: 0.82rem;
    transition: background 0.2s;
}

.msg-file-card:hover {
    background: rgba(155, 48, 255, 0.18);
}

.msg-file-card .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-file-card .file-sz {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.msg-audio-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.msg-audio-wrap .audio-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.msg-audio {
    flex: 1;
    height: 36px;
    min-width: 150px;
    max-width: 240px;
    border-radius: 8px;
}

/* ================= INPUT AREA ================= */
.input-area {
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 14px)) 16px;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

.input-area input[type="text"] {
    flex: 1;
    min-width: 0;
    background: rgba(155, 48, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s;
}

.input-area input[type="text"]::placeholder {
    color: var(--text-muted);
}

.input-area input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(224, 64, 251, 0.1);
}

/* ================= BUTTONS ================= */
.btn-send,
.btn-attach,
.btn-mic,
.btn-video {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

.btn-send {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(155, 48, 255, 0.4);
}

.btn-send svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.btn-attach,
.btn-mic,
.btn-video {
    background: rgba(155, 48, 255, 0.1);
    border: 1px solid var(--glass-border);
}

.btn-attach:hover,
.btn-mic:hover,
.btn-video:hover {
    background: rgba(155, 48, 255, 0.22);
}

.btn-mic svg,
.btn-video svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: fill 0.2s;
}

.btn-mic:hover svg,
.btn-video:hover svg {
    fill: var(--text-primary);
}

.btn-mic.recording,
.btn-video.recording {
    background: rgba(255, 64, 96, 0.2);
    border-color: rgba(255, 64, 96, 0.5);
    animation: recPulse 1s ease-in-out infinite;
}

.btn-mic.recording svg,
.btn-video.recording svg {
    fill: var(--danger);
}

@keyframes recPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 64, 96, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255, 64, 96, 0); }
}

/* ================= LOBBY ================= */
.lobby {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(20px + env(safe-area-inset-top, 20px)) 20px calc(20px + env(safe-area-inset-bottom, 20px)) 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.lobby-card {
    margin: auto;
    margin-top: 40px;
    width: 100%;
    max-width: 460px;
    padding: 40px 36px;
    text-align: center;
}

.lobby-card .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.lobby-card .logo span {
    color: #e040fb !important;
}

.logo-icon {
    height: 2.2rem;
    width: auto;
    display: block;
}

.logo-by {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 6px;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

.lobby-card .subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.features-list li {
    font-size: 0.78rem;
    color: rgba(210, 180, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
}

.users-stat-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(155, 48, 255, 0.12);
    border: 1px solid rgba(155, 48, 255, 0.25);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.78rem;
    color: var(--text-primary);
    margin-top: 20px;
    letter-spacing: 0.3px;
}

.users-stat-icon {
    font-size: 0.95rem;
}

.users-stat-num {
    color: var(--accent);
    font-weight: 700;
}

.lobby-card label {
    display: block;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lobby-card input {
    width: 100%;
    background: rgba(155, 48, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    margin-bottom: 18px;
    transition: all 0.2s;
}

.lobby-card input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(224, 64, 251, 0.1);
}

.lobby-card input::placeholder {
    color: var(--text-muted);
}

.btn-join {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(155, 48, 255, 0.35);
}

.btn-install {
    width: 100%;
    padding: 11px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-install:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.lobby-card .privacy-note {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 20px;
    line-height: 1.5;
}

.privacy-note svg {
    width: 12px;
    height: 12px;
    fill: var(--success);
    vertical-align: -1px;
    margin-right: 2px;
}

/* ================= COPYRIGHT ================= */
.copyright {
    margin-top: 24px;
    text-align: center;
}

.copyright-top {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.copyright-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.78rem;
    padding: 10px 0;
}

.copyright-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.copyright-links a:hover {
    color: #e040fb;
}

.copyright-sep {
    color: rgba(224, 64, 251, 0.5);
    font-weight: 300;
}

.copyright-glow {
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e040fb 30%, #9b30ff 70%, transparent);
    margin-top: 2px;
    box-shadow: 0 0 8px rgba(224, 64, 251, 0.4);
}

.madeby-wrap {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.madeby-wrap a {
    display: inline-block;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.madeby-wrap a:hover {
    opacity: 1;
}

.madeby-wrap img {
    height: 32px;
    width: auto;
    display: block;
}

/* ================= OVERLAYS ================= */
.lt-overlay {
    position: fixed;
    inset: 0;
    z-index: 9900;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.lt-overlay.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lt-modal {
    background: rgba(14, 6, 26, 0.98);
    border: 1px solid rgba(155, 48, 255, 0.3);
    border-radius: 18px;
    padding: 28px 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.lt-modal-title {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lt-modal-body {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.6;
}

.lt-form-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.lt-form-select,
.lt-form-textarea {
    width: 100%;
    background: rgba(155, 48, 255, 0.08);
    border: 1px solid rgba(155, 48, 255, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.84rem;
    outline: none;
    transition: border 0.2s;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.lt-form-select:focus,
.lt-form-textarea:focus {
    border-color: var(--accent);
}

.lt-form-textarea {
    height: 78px;
    resize: none;
}

.lt-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

.lt-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.lt-btn-cancel {
    background: rgba(155, 48, 255, 0.1);
    color: var(--text-muted);
}

.lt-btn-cancel:hover {
    background: rgba(155, 48, 255, 0.2);
}

.lt-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
}

.lt-btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(155, 48, 255, 0.4);
}

.lt-btn-danger {
    background: rgba(255, 64, 96, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 64, 96, 0.28);
}

.lt-btn-danger:hover {
    background: rgba(255, 64, 96, 0.24);
}

/* ================= CONTEXT MENU ================= */
.msg-ctx-menu {
    position: fixed;
    z-index: 999999 !important;
    background: rgba(14, 6, 26, 0.97);
    border: 1px solid rgba(155, 48, 255, 0.35);
    border-radius: 12px;
    padding: 6px 0;
    min-width: 196px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    animation: ctxIn 0.15s ease-out;
    user-select: none;
}

@keyframes ctxIn {
    from { opacity: 0; transform: scale(0.93); }
    to { opacity: 1; transform: scale(1); }
}

.msg-ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.83rem;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-primary);
}

.msg-ctx-item:hover {
    background: rgba(155, 48, 255, 0.15);
}

.msg-ctx-item.ctx-danger {
    color: var(--danger);
}

.msg-ctx-divider {
    height: 1px;
    background: rgba(155, 48, 255, 0.15);
    margin: 4px 0;
}

/* ================= LANGUAGE PICKER ================= */
.lang-picker {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9999;
}

.lang-globe-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.lang-globe-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(155, 48, 255, 0.35);
}

.lang-flags {
    position: absolute;
    bottom: 48px;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: all 0.2s;
}

.lang-flags.open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-primary);
    transition: background 0.15s;
    white-space: nowrap;
}

.lang-option:hover {
    background: rgba(155, 48, 255, 0.18);
}

.lang-option.active {
    background: rgba(155, 48, 255, 0.28);
    font-weight: 600;
}

.lang-flag {
    font-size: 1.1rem;
}

/* ================= HELP OVERLAY ================= */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    background: rgba(10, 0, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.help-modal {
    max-width: 460px;
    width: 100%;
    padding: 28px 26px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}

.help-modal h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 18px;
    text-align: center;
}

.help-section {
    margin-bottom: 16px;
}

.help-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.help-section p {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 4px;
}

.help-divider {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 14px 0;
}

.help-disclaimer {
    background: rgba(255, 64, 96, 0.07);
    border: 1px solid rgba(255, 64, 96, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.78rem;
    color: #ffb3be;
    line-height: 1.6;
}

.btn-close-help {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 18px;
}

.btn-close-help:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(155, 48, 255, 0.4);
}

/* ================= PASSWORD OVERLAY ================= */
.pwd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1200;
    background: rgba(10, 0, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pwd-modal {
    max-width: 340px;
    width: 100%;
    padding: 28px 24px;
    text-align: center;
}

.pwd-modal .icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.pwd-modal h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}

.pwd-modal p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.pwd-modal input {
    width: 100%;
    background: rgba(155, 48, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    margin-bottom: 10px;
    transition: all 0.2s;
    text-align: center;
    letter-spacing: 0.1em;
}

.pwd-modal input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(224, 64, 251, 0.1);
}

.pwd-error {
    font-size: 0.76rem;
    color: var(--danger);
    margin-bottom: 10px;
    min-height: 18px;
}

.btn-pwd-ok {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 8px;
}

.btn-pwd-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(155, 48, 255, 0.4);
}

.btn-pwd-cancel {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pwd-cancel:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ================= DISCLAIMER OVERLAY ================= */
.disclaimer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(10, 0, 20, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.disclaimer-modal {
    max-width: 420px;
    width: 100%;
    padding: 32px 28px;
    text-align: center;
}

.disclaimer-icon {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.disclaimer-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.disclaimer-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.disclaimer-body {
    text-align: left;
    margin-bottom: 22px;
}

.disclaimer-body p {
    font-size: 0.82rem;
    line-height: 1.65;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.disclaimer-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px !important;
}

.disclaimer-body ul {
    list-style: none;
    margin: 0 0 12px;
}

.disclaimer-body ul li {
    font-size: 0.8rem;
    padding-left: 18px;
    position: relative;
    margin-bottom: 4px;
    color: var(--danger);
}

.disclaimer-body ul li::before {
    content: '✕';
    position: absolute;
    left: 0;
    font-size: 0.65rem;
    top: 2px;
}

.btn-disclaimer-ok {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.btn-disclaimer-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(155, 48, 255, 0.4);
}

.disclaimer-contact {
    font-size: 0.66rem;
    color: var(--text-muted);
}

.disclaimer-contact a {
    color: var(--text-muted);
    text-decoration: underline;
}

.disclaimer-contact a:hover {
    color: var(--accent);
}

/* ================= STAFF PANEL ================= */
.staff-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(224, 64, 251, 0.07);
    border: 1px solid rgba(224, 64, 251, 0.18);
    border-radius: 8px;
    padding: 4px 8px;
    gap: 8px;
    font-size: 0.73rem;
    color: #fff;
}

.staff-act-group {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.staff-act-btn {
    background: rgba(155, 48, 255, 0.12);
    border: 1px solid rgba(155, 48, 255, 0.25);
    border-radius: 6px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #fff;
    transition: background 0.15s;
    line-height: 1;
}

.staff-act-btn:hover {
    background: rgba(155, 48, 255, 0.28);
}

.staff-act-ban {
    border-color: rgba(255, 64, 96, 0.3);
    background: rgba(255, 64, 96, 0.1);
}

.staff-act-ban:hover {
    background: rgba(255, 64, 96, 0.25);
}

/* ================= IOS INSTALL BANNER ================= */
.ios-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 14px 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ios-install-banner.show {
    transform: translateY(0);
}

.ios-install-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.ios-install-text {
    flex: 1;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.ios-install-text strong {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 2px;
}

.ios-install-text span {
    color: var(--text-muted);
}

.ios-install-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

/* ================= SHARE BUTTON ================= */
.btn-share {
    background: rgba(155, 48, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    color: var(--text-muted);
}

.btn-share svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.btn-share:hover {
    background: rgba(155, 48, 255, 0.22);
    color: var(--text-primary);
}

/* ================= HEADER ICONS ================= */
.btn-hdr-icon {
    background: rgba(155, 48, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    color: var(--text-muted);
}

.btn-hdr-icon:hover {
    background: rgba(155, 48, 255, 0.22);
    color: var(--text-primary);
}

.btn-hdr-icon.btn-hdr-danger {
    border-color: rgba(255, 64, 96, 0.3);
}

.btn-hdr-icon.btn-hdr-danger:hover {
    background: rgba(255, 64, 96, 0.2);
}

.btn-leave {
    background: rgba(255, 64, 96, 0.15);
    border: 1px solid rgba(255, 64, 96, 0.3);
    color: var(--danger);
    padding: 6px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-leave:hover {
    background: rgba(255, 64, 96, 0.25);
}

/* ================= PASSWORD TOGGLE ================= */
label.pwd-toggle {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    cursor: pointer;
    user-select: none;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 0.8rem !important;
    font-weight: 400 !important;
}

.pwd-toggle input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.pwd-toggle span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pwd-row {
    margin-bottom: 18px;
}

/* ================= UTILITIES ================= */
.hidden {
    display: none !important;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    gap: 8px;
}

.empty-state svg {
    width: 40px;
    height: 40px;
    fill: var(--glass-border);
    margin-bottom: 4px;
}

.typing-indicator {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0 4px;
    min-height: 18px;
    font-style: italic;
}

.upload-progress {
    color: var(--accent);
}

/* ================= MOBILE RESPONSIVE ================= */
@media (max-width: 600px) {
    .app {
        padding: 8px;
        padding-top: calc(8px + env(safe-area-inset-top, 8px));
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 8px));
    }

    .chat-header {
        padding: calc(8px + env(safe-area-inset-top, 8px)) 10px 8px 10px;
    }

    .messages-area {
        padding: 10px;
        margin-bottom: 8px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 10px));
    }

    .input-area {
        padding: 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 8px));
        gap: 6px;
    }

    .btn-send,
    .btn-attach,
    .btn-mic,
    .btn-video {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .lobby-card {
        padding: 24px 18px;
        margin-top: 60px;
        max-width: 100%;
    }

    .lobby-card .logo {
        font-size: 1.8rem;
        letter-spacing: 1px;
        gap: 8px;
    }

    .logo-icon {
        height: 1.8rem;
    }

    .header-lock-img {
        height: 1rem;
    }

    .disclaimer-modal {
        padding: 20px 16px;
    }

    .chat-header h1 {
        font-size: 0.85rem;
    }

    .header-right {
        gap: 5px;
    }

    .btn-share,
    .btn-hdr-icon {
        width: 30px;
        height: 30px;
        border-radius: 7px;
    }

    .btn-leave {
        width: 28px;
        height: 28px;
        padding: 0;
        font-size: 0.8rem;
        border-radius: 7px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .room-badge {
        font-size: 0.65rem;
    }

    .lang-picker {
        bottom: 140px !important;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .app {
        padding: 16px;
    }

    .lobby {
        padding: 30px 40px;
    }

    .lobby-card {
        max-width: 520px;
        padding: 40px 40px;
    }

    .lobby-card .logo {
        font-size: 2.4rem;
    }

    .logo-icon {
        height: 2.4rem;
    }

    .lobby-card input {
        font-size: 1rem;
        padding: 14px 18px;
    }

    .btn-join {
        font-size: 1rem;
        padding: 16px;
    }

    .chat-header {
        padding: 16px 22px;
    }

    .chat-header h1 {
        font-size: 1.3rem;
    }

    .messages-area {
        padding: 18px;
    }

    .input-area {
        padding: 14px 18px;
        gap: 10px;
    }

    .btn-attach,
    .btn-send,
    .btn-mic,
    .btn-video {
        width: 48px;
        height: 48px;
    }

    .input-area input[type="text"] {
        font-size: 0.95rem;
    }
}