/* ===================================================================
   MONEYTREE — MODERN E2EE IP MESSENGER STYLES
   =================================================================== */

:root {
  --bg-main: #060907;
  --bg-card: rgba(14, 21, 18, 0.85);
  --bg-card-border: rgba(0, 255, 157, 0.18);
  --bg-surface: #0E1613;
  --bg-surface-hover: #14201C;
  --bg-input: #090E0C;
  
  --emerald-neon: #00FF9D;
  --emerald-glow: rgba(0, 255, 157, 0.35);
  --emerald-dim: #00D27F;
  --emerald-dark: #07472B;
  
  --text-main: #F0FDF4;
  --text-muted: #83998F;
  --text-dim: #4B6358;
  
  --danger: #FF4D4D;
  --danger-bg: rgba(255, 77, 77, 0.12);
  
  --font-mono: "JetBrains Mono", monospace;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Syne", sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-neon: 0 0 25px rgba(0, 255, 157, 0.15);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* ===== BACKGROUND AMBIENCE ===== */
.bg-glow {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle 800px at 50% -50px, rgba(0, 255, 157, 0.16), transparent 70%),
    radial-gradient(circle 600px at 10% 90%, rgba(0, 210, 127, 0.12), transparent 60%),
    radial-gradient(circle 700px at 90% 70%, rgba(7, 71, 43, 0.28), transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: pulseAmbience 12s ease-in-out infinite alternate;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 255, 157, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 157, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
}

@keyframes pulseAmbience {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.08); opacity: 1; }
}

/* ===== APP SCREENS ===== */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 1;
}

.screen.active {
  display: flex;
}

/* ===================================================================
   1. JOIN / DISCOVERY SCREEN (SCROLL FIX & 3D DEPTH)
   =================================================================== */
#join-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100dvh;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 48px 16px 90px;
  -webkit-overflow-scrolling: touch;
}

.join-card {
  margin: auto 0;
  width: 100%;
  max-width: 500px;
  background: linear-gradient(150deg, rgba(14, 25, 20, 0.92), rgba(8, 14, 11, 0.97));
  backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(0, 255, 157, 0.25);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 
    0 30px 80px -15px rgba(0, 0, 0, 0.95), 
    0 0 50px rgba(0, 255, 157, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.join-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 24px;
  height: 24px;
  border-top: 2px solid var(--emerald-neon);
  border-left: 2px solid var(--emerald-neon);
  border-top-left-radius: var(--radius-lg);
  pointer-events: none;
  filter: drop-shadow(0 0 6px var(--emerald-neon));
}

.join-card::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 24px;
  height: 24px;
  border-bottom: 2px solid var(--emerald-neon);
  border-right: 2px solid var(--emerald-neon);
  border-bottom-right-radius: var(--radius-lg);
  pointer-events: none;
  filter: drop-shadow(0 0 6px var(--emerald-neon));
}

.brand-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tree-icon {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 0 10px rgba(0, 255, 157, 0.5));
}

.logo-bracket {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  color: var(--emerald-neon);
  opacity: 0.7;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.brand-title .accent {
  color: var(--emerald-neon);
  text-shadow: 0 0 16px rgba(0, 255, 157, 0.4);
}

.protocol-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--emerald-neon);
  background: rgba(0, 255, 157, 0.08);
  border: 1px solid rgba(0, 255, 157, 0.2);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  letter-spacing: 0.05em;
}

.join-subtitle {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* LOCAL IP AUTO-DISCOVERY BOX */
.local-ip-box {
  background: rgba(0, 255, 157, 0.04);
  border: 1px solid rgba(0, 255, 157, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.local-ip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.radar-dot {
  width: 8px;
  height: 8px;
  background: var(--emerald-neon);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald-neon);
  animation: pulse 1.8s infinite;
}

.local-ip-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--emerald-neon);
  letter-spacing: 0.08em;
}

.local-ip-details {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.detected-ip {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.detected-loc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-local {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 255, 157, 0.15);
  border: 1px solid var(--emerald-neon);
  border-radius: var(--radius-sm);
  color: var(--emerald-neon);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition);
}

.btn-local:hover {
  background: var(--emerald-neon);
  color: #000;
  box-shadow: 0 0 16px rgba(0, 255, 157, 0.4);
}

.local-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.divider span {
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* FORM GROUPS */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.badge-opt {
  color: var(--emerald-neon);
  font-size: 0.65rem;
  background: rgba(0, 255, 157, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.form-group input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--emerald-neon);
  box-shadow: 0 0 12px rgba(0, 255, 157, 0.2);
  background: #0D1411;
}

.form-group input::placeholder {
  color: var(--text-dim);
}

.field-hint {
  display: block;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 5px;
}

.join-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--emerald-neon);
  color: #041009;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 20px;
}

.join-btn:hover {
  background: #25FFB0;
  box-shadow: 0 0 24px rgba(0, 255, 157, 0.5);
  transform: translateY(-1px);
}

.join-btn:active {
  transform: scale(0.98);
}

.join-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-msg {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 10px;
  text-align: center;
  min-height: 20px;
}

.trust-features {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.feature-pill {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===================================================================
   2. MAIN CHAT SCREEN & SIDEBAR
   =================================================================== */
#chat-screen {
  flex-direction: row;
  height: 100dvh;
}

/* SIDEBAR */
.sidebar {
  width: 300px;
  background: #090F0C;
  border-right: 1px solid rgba(0, 255, 157, 0.1);
  display: flex;
  flex-direction: column;
  padding: 20px;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand-logo.compact .brand-title {
  font-size: 1.3rem;
}

.room-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

.card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.room-id-text {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--emerald-neon);
  letter-spacing: 0.02em;
  word-break: break-all;
  margin-bottom: 8px;
}

.room-security-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sec-dot {
  width: 6px;
  height: 6px;
  background: var(--emerald-neon);
  border-radius: 50%;
}

.btn-card-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-card-action:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* MEMBERS LIST */
.members-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.pill-count {
  background: rgba(0, 255, 157, 0.1);
  color: var(--emerald-neon);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
}

.members-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.member-dot {
  width: 7px;
  height: 7px;
  background: var(--emerald-neon);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--emerald-neon);
}

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

.member-you-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  background: rgba(0, 255, 157, 0.15);
  color: var(--emerald-neon);
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* SIDEBAR FOOTER */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.btn-secondary.danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-leave {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-leave:hover {
  color: var(--text-main);
}

/* ===================================================================
   3. CHAT MAIN AREA
   =================================================================== */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: relative;
  background: var(--bg-main);
  overflow: hidden;
}

/* HEADER */
.chat-header {
  height: 60px;
  border-bottom: 1px solid rgba(0, 255, 157, 0.08);
  background: rgba(7, 12, 10, 0.9);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 10;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.menu-btn {
  display: none;
}

.header-room-info {
  flex: 1;
  min-width: 0;
}

.header-room-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.room-dot {
  width: 8px;
  height: 8px;
  background: var(--emerald-neon);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald-neon);
}

.header-room-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.enc-tag {
  color: var(--emerald-neon);
}

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

.user-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: var(--emerald-neon);
}

/* MESSAGES STREAM */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.welcome-box {
  margin: 20px auto 30px;
  max-width: 440px;
  text-align: center;
  padding: 24px;
  background: rgba(0, 255, 157, 0.03);
  border: 1px dashed rgba(0, 255, 157, 0.2);
  border-radius: var(--radius-md);
}

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

.welcome-box h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 6px;
  color: var(--emerald-neon);
}

.welcome-box p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.welcome-tip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* SYSTEM NOTIFICATION */
.msg-system {
  text-align: center;
  margin: 6px 0;
}

.msg-system span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  padding: 3px 12px;
  border-radius: var(--radius-full);
}

/* MESSAGE BUBBLE */
.msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.msg.self {
  align-self: flex-end;
}

.msg.other {
  align-self: flex-start;
}

.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.72rem;
  margin-bottom: 4px;
  padding: 0 4px;
}

.msg.self .msg-meta {
  justify-content: flex-end;
}

.msg-author {
  font-weight: 700;
  color: var(--emerald-neon);
}

.msg.self .msg-author {
  color: var(--text-muted);
}

.msg-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.msg-bubble {
  background: #0E1613;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--text-main);
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.msg.self .msg-bubble {
  background: #0C2117;
  border-color: rgba(0, 255, 157, 0.3);
  border-bottom-right-radius: 4px;
}

.msg.other .msg-bubble {
  border-bottom-left-radius: 4px;
}

.msg-bubble:hover {
  filter: brightness(1.06);
}

/* REPLY QUOTE IN BUBBLE */
.msg-reply-quote {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--emerald-neon);
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 8px;
  font-size: 0.78rem;
}

.reply-quote-author {
  font-weight: 700;
  color: var(--emerald-neon);
  display: block;
}

.reply-quote-body {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* IMAGE IN BUBBLE */
.msg-image-wrap {
  border-radius: 8px;
  overflow: hidden;
  max-width: 320px;
  margin-top: 4px;
  cursor: zoom-in;
}

.msg-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.msg-image:hover {
  transform: scale(1.02);
}

/* FILE ATTACHMENT CARD */
.msg-file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}

.msg-file-card:hover {
  border-color: var(--emerald-neon);
  background: rgba(0, 255, 157, 0.06);
}

.file-icon {
  font-size: 1.4rem;
}

.file-meta {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* TYPING INDICATOR */
.typing-indicator {
  padding: 0 20px 8px;
  font-size: 0.75rem;
  color: var(--emerald-neon);
  font-family: var(--font-mono);
  min-height: 22px;
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
}

.typing-dots span {
  width: 4px;
  height: 4px;
  background: var(--emerald-neon);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* REPLY PREVIEW BAR */
.reply-preview {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #0E1613;
  border-top: 1px solid rgba(0, 255, 157, 0.2);
  padding: 8px 16px;
}

.reply-preview.active {
  display: flex;
}

.reply-preview-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.reply-arrow {
  color: var(--emerald-neon);
  font-size: 1.1rem;
}

.reply-preview-body {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-to-author {
  font-weight: 700;
  color: var(--emerald-neon);
  margin-right: 6px;
}

.reply-to-text {
  color: var(--text-muted);
}

/* INPUT DOCK */
.input-dock {
  background: #090F0C;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.btn-dock-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-dock-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--emerald-neon);
}

.input-dock textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.95rem;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
  transition: var(--transition);
}

.input-dock textarea:focus {
  outline: none;
  border-color: var(--emerald-neon);
  background: #0B1410;
}

.btn-send {
  background: var(--emerald-neon);
  color: #041009;
  border: none;
  width: 42px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-send:hover {
  background: #25FFB0;
  box-shadow: 0 0 16px rgba(0, 255, 157, 0.4);
}

.btn-send:active {
  transform: scale(0.95);
}

/* ===================================================================
   LIGHTBOX & TOAST NOTIFICATIONS
   =================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(14, 22, 19, 0.95);
  border: 1px solid var(--emerald-neon);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), var(--shadow-neon);
  color: var(--emerald-neon);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===================================================================
   ANIMATIONS & RESPONSIVE DESIGN
   =================================================================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* MOBILE QUERIES */
@media (max-width: 768px) {
  .menu-btn {
    display: grid;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .join-card {
    padding: 24px 20px;
  }
  
  .msg {
    max-width: 90%;
  }
}

/* ===================================================================
   WEBRTC P2P DIRECT TRANSFER STYLES
   =================================================================== */
.p2p-tag {
  color: #00FF9D;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(0, 255, 157, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

.p2p-intro-badge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(0, 255, 157, 0.07);
  border: 1px solid rgba(0, 255, 157, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 14px 0;
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.4;
}

.p2p-intro-badge .bolt {
  font-size: 1.1rem;
  color: var(--emerald-neon);
}

.btn-dock-action.p2p-action {
  color: var(--emerald-neon);
}

.btn-dock-action.p2p-action:hover {
  background: rgba(0, 255, 157, 0.15);
  box-shadow: 0 0 14px rgba(0, 255, 157, 0.35);
  transform: scale(1.05);
}

/* P2P TRANSFER CARD */
.p2p-card {
  background: #0B1612;
  border: 1px solid rgba(0, 255, 157, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 4px 0;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: popIn 0.2s ease-out;
}

.p2p-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.p2p-card-icon {
  font-size: 1.6rem;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: rgba(0, 255, 157, 0.1);
  border-radius: var(--radius-sm);
}

.p2p-card-info {
  flex: 1;
  min-width: 0;
}

.p2p-file-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p2p-file-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--emerald-neon);
}

.p2p-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.p2p-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00D27F, #00FF9D);
  box-shadow: 0 0 10px var(--emerald-neon);
  transition: width 0.15s ease;
}

.p2p-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.p2p-btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--emerald-neon);
  color: #041009;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  margin-top: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.p2p-btn-download:hover {
  background: #25FFB0;
  box-shadow: 0 0 14px rgba(0, 255, 157, 0.4);
}

.member-direct-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--emerald-neon);
  background: rgba(0, 255, 157, 0.08);
  border: 1px solid rgba(0, 255, 157, 0.2);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

/* ===================================================================
   AD & SPONSOR BANNER STYLES
   =================================================================== */
.ad-tag-row {
  display: flex;
  margin-bottom: 6px;
}

.ad-mini-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 5px;
  border-radius: 3px;
}

/* JOIN SCREEN AD BANNER */
.join-ad-banner {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.join-ad-banner:hover {
  border-color: rgba(0, 255, 157, 0.25);
  background: rgba(0, 255, 157, 0.02);
}

.join-ad-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.ad-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.join-ad-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.join-ad-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.join-ad-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-arrow {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--emerald-neon);
}

/* SIDEBAR AD CARD */
.sidebar-ad-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.sidebar-ad-card:hover {
  border-color: rgba(0, 255, 157, 0.25);
  background: rgba(0, 255, 157, 0.02);
}

.sidebar-ad-link {
  text-decoration: none;
  display: block;
}

.sidebar-ad-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.sidebar-ad-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.sidebar-ad-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 8px;
}

.sidebar-ad-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--emerald-neon);
}

.sidebar-ad-cta:hover {
  text-decoration: underline;
}

/* ===================================================================
   QUICK ACTIONS (PRO & TIP JAR)
   =================================================================== */
.join-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.btn-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.btn-pill.pro-pill {
  border-color: rgba(255, 215, 0, 0.35);
  background: rgba(255, 215, 0, 0.08);
  color: #FFD700;
}

.btn-pill.pro-pill:hover {
  background: #FFD700;
  color: #000;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
}

.btn-pill.tip-pill {
  border-color: rgba(0, 255, 157, 0.35);
  background: rgba(0, 255, 157, 0.08);
  color: var(--emerald-neon);
}

.btn-pill.tip-pill:hover {
  background: var(--emerald-neon);
  color: #000;
  box-shadow: 0 0 16px rgba(0, 255, 157, 0.4);
}

/* SIDEBAR PRO & TIP BUTTONS */
.btn-secondary.pro-btn {
  border-color: rgba(255, 215, 0, 0.25);
  color: #FFD700;
}

.btn-secondary.pro-btn:hover {
  background: rgba(255, 215, 0, 0.12);
  border-color: #FFD700;
}

.btn-secondary.tip-btn {
  border-color: rgba(0, 255, 157, 0.25);
  color: var(--emerald-neon);
}

.btn-secondary.tip-btn:hover {
  background: rgba(0, 255, 157, 0.12);
  border-color: var(--emerald-neon);
}

/* HEADER BUTTONS */
.header-tip-btn {
  color: var(--emerald-neon);
}

.header-pro-btn {
  color: #FFD700;
}

/* ===================================================================
   MODALS: CRYPTO TIP & PRO ROOM
   =================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: #0D1612;
  border: 1px solid rgba(0, 255, 157, 0.3);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 255, 157, 0.15);
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.pro-modal-card {
  border-color: rgba(255, 215, 0, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 215, 0, 0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-icon {
  font-size: 1.3rem;
  color: var(--emerald-neon);
}

.modal-icon.gold {
  color: #FFD700;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.4;
}

/* CRYPTO TABS */
.crypto-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.crypto-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.crypto-tab-btn.active {
  background: rgba(0, 255, 157, 0.15);
  border-color: var(--emerald-neon);
  color: var(--emerald-neon);
}

.crypto-tab-pane {
  display: none;
}

.crypto-tab-pane.active {
  display: block;
}

.wallet-box {
  background: #070B09;
  border: 1px solid rgba(0, 255, 157, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
}

.wallet-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--emerald-neon);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.wallet-address {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-main);
  word-break: break-all;
  margin-bottom: 12px;
  line-height: 1.4;
}

.btn-copy-address {
  width: 100%;
  background: rgba(0, 255, 157, 0.1);
  border: 1px solid var(--emerald-neon);
  border-radius: var(--radius-sm);
  color: var(--emerald-neon);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-copy-address:hover {
  background: var(--emerald-neon);
  color: #000;
}

.wallet-links {
  margin-bottom: 16px;
}

.wallet-link-btn {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: underline;
}

.wallet-link-btn:hover {
  color: var(--emerald-neon);
}

.creator-custom-wallet {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.creator-custom-wallet label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
  background: #070B09;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-main);
}

.input-with-btn input:focus {
  outline: none;
  border-color: var(--emerald-neon);
}

.input-with-btn button {
  background: var(--emerald-neon);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

/* PRO PRICING BANNER */
.pro-pricing-banner {
  text-align: center;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.pro-price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #FFD700;
}

.pro-price-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pro-perks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.perk-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.perk-check {
  width: 20px;
  height: 20px;
  background: rgba(0, 255, 157, 0.15);
  color: var(--emerald-neon);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.perk-text {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
}

.perk-text strong {
  color: var(--text-main);
}

.perk-text span {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.pro-action-btn {
  width: 100%;
  background: linear-gradient(90deg, #FFD700, #FFA500);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  margin-bottom: 16px;
}

.pro-action-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.pro-code-section {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pro-code-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 6px;
}



