* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --terminal-green: #10b981; --slate-gray: #71717a; --panel-border: #1f1f23; --bg-dark: #0a0a0a; --text-main: #e4e4e7; }

body { font-family: 'JetBrains Mono', monospace; background: var(--bg-dark); background-image: radial-gradient(var(--panel-border) 1px, transparent 1px); background-size: 24px 24px; color: var(--text-main); height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.header { background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--panel-border); padding: 12px 30px; display: flex; justify-content: space-between; align-items: center; z-index: 100; flex-shrink: 0; }
.header-logo { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; font-weight: 800; color: var(--terminal-green); letter-spacing: 1px; }
.btn-back { padding: 8px 16px; background: rgba(16,185,129,0.05); color: var(--terminal-green); border: 1px solid var(--terminal-green); border-radius: 8px; text-decoration: none; font-size: 11px; font-weight: 700; transition: 0.2s; }
.btn-back:hover { background: rgba(16,185,129,0.15); }

.chat-container { display: flex; flex: 1; overflow: hidden; max-width: 1400px; margin: 0 auto; width: 100%; border-left: 1px solid var(--panel-border); border-right: 1px solid var(--panel-border); background: var(--bg-dark); position: relative; transition: filter 0.3s; }

.sidebar { width: 320px; background: rgba(10, 10, 10, 0.95); border-right: 1px solid var(--panel-border); display: flex; flex-direction: column; transition: 0.3s; z-index: 10; }
.sidebar-header { padding: 16px; font-weight: 800; font-size: 13px; border-bottom: 1px solid var(--panel-border); background: #000; display: flex; justify-content: space-between; align-items: center; color: var(--slate-gray); }
.btn-add { background: rgba(16,185,129,0.1); border: 1px solid var(--terminal-green); color: var(--terminal-green); border-radius: 4px; padding: 4px 10px; font-size: 11px; font-weight: 800; cursor: pointer; transition: 0.2s; }
.btn-add:hover { background: rgba(16,185,129,0.2); }

.contact-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 5px; }
.contact-item { padding: 12px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 12px; }
.contact-item:hover { background: rgba(16,185,129,0.03); border-color: rgba(16,185,129,0.1); }
.contact-item.active { background: rgba(16,185,129,0.08); border-color: var(--terminal-green); }

.avatar { width: 38px; height: 38px; border-radius: 6px; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; font-size: 16px; border: 1px solid var(--terminal-green); color: var(--terminal-green); font-weight: bold; flex-shrink: 0; }
.contact-info { flex: 1; min-width: 0; }
.contact-nick { font-weight: 800; font-size: 13px; color: var(--text-main); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-pk { font-size: 10px; color: var(--slate-gray); font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-area { flex: 1; display: flex; flex-direction: column; background: #050505; position: relative; overflow: hidden; }

.traitor-watermark { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.02; font-size: 20px; font-weight: 900; color: #fff; word-break: break-all; overflow: hidden; z-index: 1; display: flex; flex-wrap: wrap; user-select: none; line-height: 2; transform: rotate(-15deg) scale(1.5); }

.chat-header { padding: 12px 20px; background: rgba(10, 10, 10, 0.95); border-bottom: 1px solid var(--panel-border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; z-index: 5; gap: 10px; }
.chat-header-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }
.chat-header-controls { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.chat-header .avatar { width: 32px; height: 32px; font-size: 14px; border-color: var(--slate-gray); color: var(--slate-gray); }
.chat-title-box { flex: 1; min-width: 0; display: flex; align-items: center; }
.chat-title { font-size: 15px; font-weight: 800; color: var(--terminal-green); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-transform: uppercase; letter-spacing: 1px; }

.doomsday-clock { color:#ef4444; font-family:monospace; font-size:12px; background:rgba(239,68,68,0.1); padding:2px 8px; border-radius:4px; border:1px solid #ef4444; white-space: nowrap; }

.btn-action { background: rgba(239,68,68,0.05); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); padding: 6px 12px; border-radius: 6px; font-weight: 800; font-size: 11px; cursor: pointer; transition: 0.2s; font-family: inherit; }
.btn-action:hover { background: rgba(239,68,68,0.15); box-shadow: 0 0 10px rgba(239,68,68,0.3); }
.btn-share { background: rgba(16,185,129,0.05); color: var(--terminal-green); border: 1px solid rgba(16,185,129,0.3); padding: 6px 12px; border-radius: 6px; font-weight: 800; font-size: 11px; cursor: pointer; font-family: inherit; }
.btn-share:hover { background: rgba(16,185,129,0.15); }
.btn-stealth { background: rgba(59,130,246,0.05); color: #3b82f6; border: 1px solid rgba(59,130,246,0.3); padding: 6px 12px; border-radius: 6px; font-weight: 800; font-size: 11px; cursor: pointer; font-family: inherit; transition: 0.2s; }
.btn-stealth:disabled { border-color: var(--panel-border); color: var(--slate-gray); background: transparent; cursor: not-allowed; }
.btn-stealth.active { background: rgba(59,130,246,0.2); border-color: #3b82f6; box-shadow: 0 0 10px rgba(59,130,246,0.5); }

.message-list { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; z-index: 2; position: relative; }
.msg-row { display: flex; width: 100%; flex-direction: column; transition: 0.3s; }
.msg-row.sent { align-items: flex-end; }
.msg-row.received { align-items: flex-start; }

.sender-name { font-size: 11px; margin-bottom: 3px; font-weight: 900; display: flex; align-items: center; width: 100%; text-shadow: 0px 0px 5px rgba(0,0,0,0.5); }

.bubble { position: relative; max-width: 80%; padding: 10px 14px; border-radius: 8px; font-size: 13px; line-height: 1.5; word-break: break-word; font-family: inherit; transition: 0.2s; }
.msg-row.sent .bubble { background: rgba(16,185,129,0.1); color: var(--terminal-green); border: 1px solid rgba(16,185,129,0.2); border-bottom-right-radius: 0; }
.msg-row.received .bubble { background: rgba(255,255,255,0.02); color: var(--text-main); border: 1px solid var(--panel-border); border-bottom-left-radius: 0; }

.bubble-cipher { display: none; font-family: monospace; font-weight: bold; color: var(--terminal-green); letter-spacing: 1px; word-break: break-all; }
.blurry-mode .bubble-content { display: none; }
.blurry-mode .bubble-cipher { display: block; }
.blurry-mode .bubble:hover .bubble-content { display: block; }
.blurry-mode .bubble:hover .bubble-cipher { display: none; }

.quote-block { background: rgba(0,0,0,0.4); border-left: 3px solid var(--terminal-green); padding: 8px 10px; margin-bottom: 8px; border-radius: 4px; font-size: 11px; opacity: 0.8; word-break: break-word; }
.msg-row.received .quote-block { border-left-color: #3b82f6; }
.quote-sender { font-weight: bold; margin-bottom: 4px; opacity: 0.9; }
.msg-row.sent .quote-sender { color: var(--terminal-green); }
.msg-row.received .quote-sender { color: #3b82f6; }

.media-preview { max-width: 100%; max-height: 250px; border-radius: 6px; cursor: pointer; transition: 0.2s; border: 1px solid rgba(255,255,255,0.1); }
.media-preview:hover { opacity: 0.8; border-color: var(--terminal-green); }

/* V28: WhatsApp Style Custom Audio Player - Native Binding */
.vn-box { display: flex; align-items: center; gap: 10px; background: rgba(16,185,129,0.1); padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(16,185,129,0.3); cursor: pointer; width: 240px; transition: 0.2s; }
.vn-box:hover { background: rgba(16,185,129,0.2); }
.msg-row.received .vn-box { background: rgba(255,255,255,0.05); border-color: var(--panel-border); }
.vn-btn { background: var(--terminal-green); color: #000; width: 30px; height: 30px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 12px; flex-shrink: 0; font-weight: bold; }
.msg-row.received .vn-btn { background: var(--slate-gray); color: #fff; }
.vn-wave { flex: 1; height: 20px; display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.vn-wave span { flex: 1; background: var(--terminal-green); border-radius: 2px; animation: vn-pulse 1s infinite alternate; }
.msg-row.received .vn-wave span { background: var(--slate-gray); }
.vn-wave span:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.vn-wave span:nth-child(2) { height: 80%; animation-delay: 0.2s; }
.vn-wave span:nth-child(3) { height: 60%; animation-delay: 0.3s; }
.vn-wave span:nth-child(4) { height: 100%; animation-delay: 0.4s; }
.vn-wave span:nth-child(5) { height: 50%; animation-delay: 0.5s; }
.vn-wave span:nth-child(6) { height: 70%; animation-delay: 0.6s; }
.vn-wave span:nth-child(7) { height: 30%; animation-delay: 0.7s; }
.vn-wave span:nth-child(8) { height: 90%; animation-delay: 0.8s; }
@keyframes vn-pulse { 0% { opacity: 0.3; transform: scaleY(0.5); } 100% { opacity: 1; transform: scaleY(1); } }
.vn-wave.paused span { animation-play-state: paused; opacity: 0.5; transform: scaleY(0.3); }

#typing-indicator { padding: 4px 20px; font-size: 10px; color: var(--terminal-green); font-style: italic; font-weight: bold; background: transparent; display: none; animation: pulse-text 1.5s infinite; z-index: 3; }
@keyframes pulse-text { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

.reply-banner { display: none; padding: 10px 20px; background: rgba(59,130,246,0.1); border-top: 1px solid var(--panel-border); font-size: 11px; color: #3b82f6; align-items: center; justify-content: space-between; border-left: 2px solid #3b82f6; z-index: 5; }
.reply-banner-text { display: flex; flex-direction: column; }
.reply-banner-text strong { color: #3b82f6; margin-bottom: 2px; }
.reply-banner-text span { opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; display: inline-block; }

.input-area { padding: 12px 20px; background: rgba(10, 10, 10, 0.95); border-top: 1px solid var(--panel-border); display: flex; gap: 8px; align-items: center; z-index: 5; }
.input-text { flex: 1; background: #000; border: 1px solid var(--panel-border); padding: 12px 16px; border-radius: 6px; color: var(--text-main); outline: none; font-family: inherit; font-size: 13px; min-width: 0; }
.input-text:focus { border-color: var(--terminal-green); }
.input-text:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-send { background: rgba(16,185,129,0.1); color: var(--terminal-green); border: 1px solid var(--terminal-green); padding: 12px 20px; border-radius: 6px; font-weight: 800; font-family: inherit; cursor: pointer; transition: 0.2s; }
.btn-send:hover:not(:disabled) { background: rgba(16,185,129,0.2); }
.btn-send:disabled { border-color: var(--panel-border); color: var(--slate-gray); background: transparent; cursor: not-allowed; }

.btn-icon { background: #000; color: var(--text-main); border: 1px solid var(--panel-border); padding: 10px; border-radius: 6px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; user-select: none; flex-shrink: 0; transition: 0.2s; }
.btn-icon:hover:not(:disabled) { border-color: var(--slate-gray); }
.btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-icon.recording { background: rgba(239,68,68,0.2) !important; color: #ef4444 !important; border-color: #ef4444 !important; animation: pulse 1s infinite; }

.sel-chronos { background: #000; border: 1px solid var(--panel-border); color: #f59e0b; padding: 10px; border-radius: 6px; font-family: inherit; font-size: 12px; outline: none; font-weight: bold; cursor: pointer; }

@keyframes emp-shake {
    0% { transform: translate(2px, 2px) rotate(0deg); filter: hue-rotate(90deg) contrast(200%); }
    10% { transform: translate(-2px, -3px) rotate(-1deg); }
    20% { transform: translate(-4px, 0px) rotate(1deg); }
    30% { transform: translate(4px, 3px) rotate(0deg); }
    40% { transform: translate(2px, -2px) rotate(1deg); }
    50% { transform: translate(-2px, 3px) rotate(-1deg); }
    60% { transform: translate(-4px, 2px) rotate(0deg); }
    70% { transform: translate(4px, 2px) rotate(-1deg); filter: hue-rotate(180deg) contrast(200%); }
    80% { transform: translate(-2px, -2px) rotate(1deg); }
    90% { transform: translate(2px, 3px) rotate(0deg); }
    100% { transform: translate(2px, -3px) rotate(-1deg); filter: none; }
}
.emp-active { animation: emp-shake 0.6s cubic-bezier(.36,.07,.19,.97) both; }

@keyframes pulse-border { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); } 70% { box-shadow: 0 0 0 15px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }

#video-grid-overlay { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 50; flex-wrap: wrap; align-content: flex-start; padding: 20px; gap: 10px; overflow-y: auto; }
.video-wrapper { position: relative; flex: 1 1 30%; min-width: 250px; background: #000; border: 1px solid var(--terminal-green); border-radius: 8px; overflow: hidden; }
.video-wrapper video { width: 100%; height: 100%; object-fit: cover; }
.video-label { position: absolute; bottom: 10px; left: 10px; background: rgba(0,0,0,0.7); color: var(--terminal-green); font-size: 11px; padding: 4px 8px; border-radius: 4px; font-weight: bold; }
.btn-end-call { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 51; display: none; padding: 10px 20px; font-size: 14px; background: rgba(239,68,68,0.9); color: #fff; border: 2px solid #ef4444; border-radius: 8px; cursor: pointer; font-weight: bold; }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); backdrop-filter: blur(4px); z-index: 9999; justify-content: center; align-items: center; padding: 20px; }
.modal-box { background: #0a0a0a; border: 1px solid var(--panel-border); border-radius: 12px; padding: 25px; width: 100%; max-width: 400px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.modal-box.create-mode { border-color: var(--terminal-green); }
.modal-box.join-mode { border-color: #f59e0b; }
.modal-title { font-size: 14px; font-weight: 800; margin-bottom: 20px; text-align: center; font-family: monospace; letter-spacing: 1px; color: var(--text-main); }
.t-input { width: 100%; padding: 12px; background: #000; border: 1px solid var(--panel-border); color: #fff; font-family: inherit; font-size: 13px; border-radius: 6px; outline: none; }
.t-input:focus { border-color: var(--terminal-green); }
.t-btn-block { width: 100%; padding: 12px; background: transparent; font-weight: 800; font-family: inherit; font-size: 13px; border-radius: 6px; cursor: pointer; transition: 0.2s; border: 1px solid var(--terminal-green); color: var(--terminal-green); }
.t-btn-block:hover { background: rgba(16,185,129,0.15); }

#media-modal-content { max-width: 100%; max-height: 85vh; border-radius: 8px; border: 1px solid var(--panel-border); box-shadow: 0 0 30px rgba(0,0,0,0.8); }

.user-list-item { padding: 10px; border-bottom: 1px dashed var(--panel-border); display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: bold; }
.user-list-item:last-child { border-bottom: none; }
.dot-online { width: 8px; height: 8px; background: var(--terminal-green); border-radius: 50%; box-shadow: 0 0 8px var(--terminal-green); }

.nuke-overlay { display: none; position: fixed; top:0; left:0; width:100vw; height:100vh; background: #ef4444; z-index: 99999; justify-content: center; align-items: center; flex-direction: column; animation: nukeFlash 0.5s infinite alternate; }
@keyframes nukeFlash { 0% { background: #ef4444; } 100% { background: #991b1b; } }

#lock-screen { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background: #050505; z-index: 9999999; flex-direction: column; justify-content: center; align-items: center; }
#master-login-screen { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background: #000; z-index: 9999999; flex-direction: column; justify-content: center; align-items: center; }
.master-title { color: var(--terminal-green); font-size: 24px; font-weight: 900; margin-bottom: 10px; font-family: monospace; letter-spacing: 2px; }
.master-subtitle { color: var(--slate-gray); font-size: 12px; margin-bottom: 30px; font-family: monospace; }
#master-auth-input { padding: 15px; background: #000; color: #fff; border: 1px solid var(--terminal-green); text-align: center; font-size: 20px; outline: none; width: 300px; border-radius: 8px; font-family: monospace; letter-spacing: 5px; transition: 0.2s; }
#master-auth-input:focus { box-shadow: 0 0 15px rgba(16,185,129,0.3); }

.btn-mobile-back { display: none; background: transparent; color: var(--terminal-green); border: none; font-size: 20px; padding-right: 10px; cursor: pointer; }

@media (max-width: 768px) {
    .header { padding: 10px 15px; }
    .header-logo { font-size: 1.1rem; }
    .chat-container { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; flex: 1; }
    .chat-area { width: 100%; display: none; }
    .chat-container.in-chat .sidebar { display: none; }
    .chat-container.in-chat .chat-area { display: flex; flex: 1; }
    
    .btn-mobile-back { display: block; }
    .chat-header { flex-direction: column; align-items: flex-start; }
    .chat-header-info { width: 100%; margin-bottom: 5px; }
    .chat-header-controls { width: 100%; justify-content: flex-start; }
    .chat-title-box { overflow: visible; white-space: normal; }
    
    .input-area { padding: 10px; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
    .input-text { width: 100%; flex: 1 1 100%; order: 1; margin-bottom: 5px; }
    .btn-icon { order: 2; flex: 1; padding: 10px 0; }
    .sel-chronos { order: 3; flex: 1; text-align: center; }
    .btn-send { order: 4; flex: 2; padding: 10px 0; }
    
    .bubble { max-width: 95%; }
}
/* ==========================================
   VOID NATIVE TOAST NOTIFICATION SYSTEM
   ========================================== */
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.void-toast { background: rgba(10, 10, 10, 0.95); border-left: 4px solid var(--terminal-green); color: var(--text-main); padding: 12px 20px; border-radius: 4px; font-size: 12px; font-weight: bold; box-shadow: 0 4px 15px rgba(0,0,0,0.8); font-family: 'JetBrains Mono', monospace; animation: toast-slide-down 0.3s ease-out forwards; backdrop-filter: blur(5px); text-transform: uppercase; }
.void-toast.danger { border-color: #ef4444; color: #ef4444; }
.void-toast.warning { border-color: #f59e0b; color: #f59e0b; }
.void-toast.success { border-color: #2ecc71; color: #2ecc71; }
@keyframes toast-slide-down { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-fade-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }