* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; }
body { background: #0f172a; color: #f8fafc; height: 100vh; height: 100dvh; overflow: hidden; user-select: none; }
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.95); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 15px; }
.box { background: #1e293b; padding: 25px; border-radius: 14px; width: 100%; max-width: 400px; text-align: center; border: 1px solid #334155; }
.box h2 { color: #38bdf8; margin-bottom: 10px; font-size: 20px; }
.box p { font-size: 13px; color: #94a3b8; margin-bottom: 12px; }
.box input, .box select { width: 100%; padding: 11px; margin-bottom: 10px; border-radius: 8px; border: 1px solid #475569; background: #0f172a; color: #fff; font-size: 14px; }
.primary-btn { width: 100%; padding: 12px; background: #0284c7; border: none; border-radius: 8px; color: #fff; font-weight: bold; cursor: pointer; font-size: 15px; }
.err-text { color: #ef4444; font-size: 13px; margin-bottom: 10px; font-weight: bold; }

.app { display: flex; height: 100vh; height: 100dvh; position: relative; }
.sidebar { width: 270px; background: #1e293b; border-right: 1px solid #334155; display: flex; flex-direction: column; z-index: 50; transition: transform 0.25s ease; }
.brand { padding: 14px; font-size: 15px; font-weight: bold; color: #38bdf8; border-bottom: 1px solid #334155; display: flex; justify-content: space-between; align-items: center; }
.close-menu-btn { display: none; background: #ef4444; border: none; color: #fff; padding: 4px 10px; border-radius: 6px; font-weight: bold; cursor: pointer; }
.sec-title { padding: 10px 14px 4px; font-size: 11px; text-transform: uppercase; color: #94a3b8; font-weight: bold; }
.room-list { padding: 5px 10px; border-bottom: 1px solid #334155; max-height: 220px; overflow-y: auto; }
.room-btn { width: 100%; text-align: left; padding: 8px 10px; background: transparent; border: none; color: #cbd5e1; border-radius: 6px; cursor: pointer; margin-bottom: 2px; font-size: 13px; }
.room-btn.active { background: #0284c7; color: #fff; font-weight: bold; }
.user-list { flex: 1; overflow-y: auto; padding: 8px 10px; }
.user-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; border-radius: 6px; font-size: 13px; border-bottom: 1px solid #0f172a; }
.user-info { cursor: pointer; flex: 1; }
.badge { background: #f59e0b; color: #000; font-size: 10px; padding: 2px 5px; border-radius: 4px; font-weight: bold; margin-left: 4px; }
.ban-btn { background: #ef4444; color: #fff; border: none; padding: 4px 8px; border-radius: 4px; font-size: 11px; cursor: pointer; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header { padding: 10px 12px; background: #1e293b; border-bottom: 1px solid #334155; display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.header-left { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; background: #0284c7; border: none; color: #fff; padding: 6px 10px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 14px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn { padding: 6px 10px; border-radius: 6px; border: none; color: #fff; font-weight: bold; cursor: pointer; font-size: 12px; }
.btn-mic-off { background: #ef4444; }
.btn-mic-on { background: #10b981; }
.btn-radio { background: #8b5cf6; }
.btn-admin { background: #f59e0b; color: #000; display: none; }
.btn-clear { background: #dc2626; display: none; }

.dm-bar { background: #3b0764; padding: 8px 14px; font-size: 13px; display: none; justify-content: space-between; align-items: center; }
.dm-bar button { background: #ef4444; border: none; color: #fff; padding: 4px 10px; border-radius: 4px; cursor: pointer; }
.messages { flex: 1; padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.msg { background: #1e293b; padding: 9px 12px; border-radius: 10px; max-width: 82%; border: 1px solid #334155; font-size: 14px; word-wrap: break-word; }
.msg.private { background: #311042; border-color: #6b21a8; }
.msg-head { font-size: 11px; color: #38bdf8; margin-bottom: 3px; font-weight: bold; }
.sys { text-align: center; font-size: 12px; color: #94a3b8; font-style: italic; }

.emoji-bar { display: none; background: #1e293b; border-top: 1px solid #334155; padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
.emoji-bar span { font-size: 20px; cursor: pointer; padding: 2px 4px; }
.controls { padding: 10px; background: #1e293b; border-top: 1px solid #334155; display: flex; gap: 6px; align-items: center; }
.controls input[type="text"] { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid #475569; background: #0f172a; color: #fff; font-size: 14px; min-width: 0; }
.img-lbl { background: #334155; padding: 10px; border-radius: 8px; cursor: pointer; font-size: 14px; border: none; color: #fff; }
.btn-send { background: #0284c7; padding: 10px 14px; font-size: 13px; }

.once-btn { background: #0ea5e9; color: #fff; border: none; padding: 7px 12px; border-radius: 6px; font-weight: bold; cursor: pointer; margin-top: 4px; }
.once-btn.viewed { background: #475569; color: #cbd5e1; cursor: not-allowed; }
.log-box { flex: 1; overflow-y: auto; background: #0f172a; padding: 10px; border-radius: 8px; text-align: left; font-size: 12px; margin: 10px 0; border: 1px solid #334155; }
.ban-box { background: #0f172a; padding: 10px; border-radius: 8px; text-align: left; font-size: 12px; margin-bottom: 10px; border: 1px solid #334155; }
.unban-btn { background: #10b981; color: #fff; border: none; padding: 2px 6px; border-radius: 4px; cursor: pointer; font-size: 11px; margin-left: 5px; }

@media (max-width: 768px) {
  .menu-btn { display: inline-block; }
  .close-menu-btn { display: inline-block; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); width: 260px; box-shadow: 4px 0 15px rgba(0,0,0,0.6); }
  .sidebar.open { transform: translateX(0); }
  .header h3 { font-size: 15px; }
  .btn { padding: 5px 8px; font-size: 11px; }
}
