:root {
  --bg: #07090e;
  --card-bg: rgba(18, 23, 37, 0.75);
  --card-solid: #111625;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(99, 102, 241, 0.4);
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #818cf8;
  --primary-glow: rgba(79, 70, 229, 0.25);
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.2);
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --success: #10b981;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 20px 45px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Modern, subtle scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

html {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Viewport locked ONLY when actively in chat */
body.in-chat {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 15% 15%, rgba(79, 70, 229, 0.12) 0px, transparent 50%),
    radial-gradient(at 85% 85%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  display: flex;
  flex-direction: column;
  letter-spacing: -0.01em;
}

/* Header Bar */
.app-header {
  flex-shrink: 0;
  padding: 14px 24px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 40;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.brand-text span {
  color: var(--accent);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #34d399;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Container */
.main-wrapper {
  flex: 1;
  min-height: 0;
  max-width: 740px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: #fff;
  position: relative;
  user-select: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.4);
  filter: brightness(1.06);
}

.btn-danger {
  background: var(--danger-bg);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-accent {
  background: linear-gradient(135deg, #0284c7 0%, var(--accent) 100%);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 10px;
  border-radius: var(--radius-sm);
}

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

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Modal / Onboarding Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-dialog {
  background: var(--card-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.modal-header-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(79, 70, 229, 0.14);
  border: 1px solid rgba(79, 70, 229, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  margin-bottom: 20px;
}

.modal-dialog h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-dialog p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input, .form-select {
  width: 100%;
  padding: 13px 16px;
  background: rgba(7, 10, 19, 0.7);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Lobby View */
.view-lobby {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  margin: auto 0;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(79, 70, 229, 0.12);
  border: 1px solid rgba(79, 70, 229, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--primary-light);
  font-weight: 600;
  margin-bottom: 18px;
}

.view-lobby h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.25;
}

.view-lobby p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 32px;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.mode-card {
  background: rgba(7, 10, 19, 0.5);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mode-card .icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.mode-card span {
  font-size: 0.92rem;
  font-weight: 600;
  color: #e2e8f0;
}

.mode-card.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  box-shadow: 0 0 24px var(--primary-glow);
}

.mode-card.active .icon-box {
  background: var(--primary);
  color: #fff;
}

/* Radar / Searching View */
.view-searching {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  text-align: center;
  padding: 40px 20px;
}

.radar-outer {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.radar-pulse {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  animation: radar-expand 2.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.radar-pulse:nth-child(2) {
  animation-delay: 0.7s;
}

.radar-core {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 30px var(--primary-glow);
  z-index: 2;
}

@keyframes radar-expand {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.9); opacity: 0; }
}

.view-searching h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.view-searching p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

/* Chat View */
.view-chat {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  position: relative;
}

.chat-topbar {
  flex-shrink: 0;
  padding: 12px 18px;
  background: rgba(11, 15, 25, 0.9);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 20;
}

.peer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.peer-avatar-frame {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e293b;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  position: relative;
}

.peer-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s ease;
}

.peer-avatar-img.blurred {
  filter: blur(12px) brightness(0.85);
  transform: scale(1.15);
}

.peer-texts {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.peer-name {
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.peer-campus-tag {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Message Stream */
.chat-stream {
  flex: 1;
  min-height: 0;
  padding: 14px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.chat-stream::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.chat-bubble {
  max-width: 100%;
  width: fit-content;
  padding: 6px 11px;
  border-radius: 15px;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
  animation: bubble-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

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

.chat-bubble.in {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 4px;
  color: #f1f5f9;
}

.chat-bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%);
  border-bottom-right-radius: 4px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.chat-notice {
  align-self: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.image-preview-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  display: block;
  transition: transform 0.2s ease;
}

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

.image-preview-card img {
  display: block;
  max-width: 240px;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Messenger-Style Stacked Media Deck */
.media-stacked-deck {
  position: relative;
  width: 210px;
  height: 250px;
  cursor: pointer;
  user-select: none;
  margin: 6px 10px;
}

.deck-card {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 2px 6px rgba(0, 0, 0, 0.4);
  background: #0f172a;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.deck-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fan-out tilt effects matching Messenger reference image */
.deck-card.layer-0 {
  transform: rotate(-6deg) translate(-10px, -6px);
  z-index: 1;
  opacity: 0.85;
  filter: brightness(0.85);
}

.deck-card.layer-1 {
  transform: rotate(5deg) translate(8px, -4px);
  z-index: 2;
  opacity: 0.92;
  filter: brightness(0.92);
}

.deck-card.layer-2 {
  transform: rotate(0deg) translate(0, 0);
  z-index: 3;
  opacity: 1;
}

.media-stacked-deck:hover .deck-card.layer-0 {
  transform: rotate(-10deg) translate(-16px, -10px);
}

.media-stacked-deck:hover .deck-card.layer-1 {
  transform: rotate(9deg) translate(14px, -6px);
}

.media-stacked-deck:hover .deck-card.layer-2 {
  transform: scale(1.02);
}

/* Deck Count Pill Badge */
.deck-counter-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

/* Video Player Bubble */
.video-preview-card {
  border-radius: 16px;
  overflow: hidden;
  max-width: 270px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.video-preview-card video {
  display: block;
  width: 100%;
  max-height: 320px;
  border-radius: 16px;
  outline: none;
  background: #000;
}

/* Interactive Carousel Lightbox */
.media-carousel-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: bubble-in 0.2s ease;
}

.lightbox-stage {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-stage img, .lightbox-stage video {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.85);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 100;
  user-select: none;
}

.lightbox-nav-btn:hover {
  background: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-prev { left: 20px; }
.lightbox-nav-next { right: 20px; }

.lightbox-topbar {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  z-index: 100;
}

.lightbox-counter {
  font-size: 0.92rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.7);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
}

.lightbox-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lightbox-close-btn:hover {
  background: var(--danger);
}

/* Message Row & Wrapper for Hover Tools */
.chat-row {
  display: flex;
  flex-direction: column;
  position: relative;
  max-width: 76%;
}

.chat-row.in {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-row.out {
  align-self: flex-end;
  align-items: flex-end;
}

.bubble-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  touch-action: pan-y;
  will-change: transform;
}

.bubble-wrapper.swipe-spring {
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Mobile Swipe-to-Reply Indicator */
.swipe-reply-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.6);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.95);
  border: 1.5px solid var(--primary-light);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.chat-row.in .swipe-reply-indicator {
  left: -42px;
}

.chat-row.out .swipe-reply-indicator {
  right: -42px;
}

.swipe-reply-indicator.ready {
  background: var(--primary);
  color: #fff;
  border-color: #fff;
  transform: translateY(-50%) scale(1.15) !important;
  opacity: 1 !important;
}

/* Floating Action Trigger Buttons */
.msg-actions-trigger {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 25;
  white-space: nowrap;
}

.chat-row.out .msg-actions-trigger {
  right: 100%;
  padding-right: 6px;
}

.chat-row.in .msg-actions-trigger {
  left: 100%;
  padding-left: 6px;
}

.chat-row:hover .msg-actions-trigger,
.chat-row.show-actions .msg-actions-trigger,
.chat-row.menu-open .msg-actions-trigger,
.msg-actions-trigger:hover {
  opacity: 1;
  pointer-events: auto;
}

.action-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--card-border);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
}

.action-icon-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.12);
}

/* Floating Reactions Bar */
.reactions-bar {
  position: absolute;
  bottom: calc(100% + 6px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 12px;
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 50;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: bubble-in 0.15s ease;
}

.chat-row.out .reactions-bar {
  right: 0;
}

.chat-row.in .reactions-bar {
  left: 0;
}

.reactions-bar.show {
  display: flex;
}

.react-opt {
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.react-opt:hover {
  transform: scale(1.35) translateY(-4px);
}

/* Messenger-Style Grouped Reaction Badge on Message */
.reaction-pill {
  position: absolute;
  bottom: -7px;
  background: rgba(18, 24, 38, 0.96);
  border: 1.5px solid #07090e;
  border-radius: 999px;
  padding: 1px 5px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 15;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.reaction-pill:hover {
  transform: scale(1.08);
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(255, 255, 255, 0.32);
}

.reaction-pill .pill-emojis {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
  font-size: 0.7rem;
  line-height: 1;
}

.reaction-pill .pill-count {
  font-size: 0.65rem;
  font-weight: 700;
  color: #cbd5e1;
  line-height: 1;
  margin-left: 1px;
}

.chat-row.out .reaction-pill {
  right: 8px;
}

.chat-row.in .reaction-pill {
  left: 8px;
}

/* Messenger-Style Message Reactions Modal */
.reactions-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: bubble-in 0.18s ease;
}

.reactions-modal-overlay.hidden {
  display: none;
}

.reactions-modal-card {
  background: #18191a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.reactions-modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.reactions-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.reactions-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.reactions-modal-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
}

.reactions-modal-tabs::-webkit-scrollbar {
  display: none;
}

.reaction-tab-btn {
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.reaction-tab-btn:hover {
  color: #fff;
}

.reaction-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

.reactions-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 380px;
}

.reaction-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.reaction-user-item.can-remove {
  cursor: pointer;
}

.reaction-user-item.can-remove:hover {
  background: rgba(239, 68, 68, 0.1);
}

.reaction-user-item:not(.can-remove):hover {
  background: rgba(255, 255, 255, 0.04);
}

.reaction-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.reaction-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #94a3b8;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.reaction-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.reaction-user-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reaction-user-sub {
  font-size: 0.78rem;
  color: #94a3b8;
}

.reaction-user-item.can-remove:hover .reaction-user-sub {
  color: #f87171;
}

.reaction-user-emoji {
  font-size: 1.45rem;
  padding-left: 12px;
  flex-shrink: 0;
}

/* Three Dots Dropdown Menu */
.msg-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 6px;
  min-width: 130px;
  z-index: 100;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.7);
  animation: bubble-in 0.15s ease;
}

.msg-dropdown.show {
  display: flex;
}

.chat-row.out .msg-dropdown {
  right: 0;
}

.chat-row.in .msg-dropdown {
  left: 0;
}

.dropdown-btn {
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-btn.danger {
  color: #f87171;
}

.dropdown-btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Unsent Hollow Bubble */
.chat-bubble.unsent {
  background: transparent !important;
  border: 1px dashed rgba(255, 255, 255, 0.25) !important;
  color: #94a3b8 !important;
  font-style: italic !important;
  font-size: 0.82rem !important;
  padding: 8px 14px !important;
  box-shadow: none !important;
  width: fit-content !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
}

/* Quoted Reply Header */
.reply-quote-box {
  background: rgba(0, 0, 0, 0.22);
  border-left: 2.5px solid var(--primary-light);
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 4px;
  font-size: 0.74rem;
  color: #cbd5e1;
  opacity: 0.92;
}

/* Composer Reply Bar */
.composer-reply-bar {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.98);
  border-top: 1px solid var(--card-border);
  font-size: 0.85rem;
  color: #cbd5e1;
  z-index: 20;
}

.composer-reply-bar.show {
  display: flex;
}

/* Chat Composer Bottom Bar */
.chat-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  position: relative;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.chat-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.input-field-chat {
  width: 100%;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 10px 42px 10px 16px;
  color: #fff;
  font-size: 0.95rem;
  line-height: 20px;
  height: 42px;
  resize: none;
  overflow-y: hidden;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
  display: block;
}

.input-field-chat:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(30, 41, 59, 0.95);
}

.input-field-chat::placeholder {
  color: #64748b;
}

.btn-input-emoji {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #0ea5e9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-input-emoji:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
  color: #38bdf8;
}

/* Messenger-Style Built-in Emoji Picker Popup */
.emoji-picker-popup {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 16px;
  width: 330px;
  max-width: calc(100vw - 32px);
  height: 350px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: none;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  animation: bubble-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.emoji-picker-popup.show {
  display: flex;
}

.emoji-picker-header {
  padding: 10px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.emoji-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 7px 12px;
}

.emoji-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.85rem;
}

.emoji-search-input::placeholder {
  color: #64748b;
}

.emoji-category-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 8px 14px 4px;
}

.emoji-picker-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.emoji-picker-grid::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.emoji-item {
  font-size: 1.45rem;
  padding: 6px 2px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  user-select: none;
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease;
}

.emoji-item:hover {
  transform: scale(1.25);
  background: rgba(255, 255, 255, 0.1);
}

.emoji-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 8px;
  background: rgba(11, 15, 25, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.emoji-cat-tab {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

.emoji-cat-tab:hover, .emoji-cat-tab.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

/* Photo trigger in composer */
.chat-composer .btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-composer .btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Quick Emoji & Send Button Dynamic Transition */
.btn-quick-emoji {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  flex-shrink: 0;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  line-height: 1;
}

.btn-quick-emoji:active {
  transform: scale(1.35);
}

.btn-quick-emoji.growing {
  transform: scale(2.2) translateY(-6px);
  filter: drop-shadow(0 6px 16px rgba(239, 68, 68, 0.6));
}

.btn-submit-send {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

/* Responsive Media Queries (Mobile, Tablet, Desktop) */
@media (max-width: 680px) {
  .app-header {
    padding: 10px 14px;
  }

  .brand-wrap {
    gap: 8px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .brand-text {
    font-size: 1.1rem;
  }

  .header-right-actions {
    gap: 6px;
  }

  .landing-header-actions {
    gap: 4px;
  }

  .btn-landing-login {
    font-size: 0.8rem;
    padding: 6px 8px;
    white-space: nowrap;
  }

  .landing-header-actions .btn-sm {
    font-size: 0.8rem;
    padding: 6px 10px;
    gap: 4px;
    white-space: nowrap;
  }

  /* Landing Page Mobile Layout */
  .landing-container {
    padding: 24px 14px 60px;
    gap: 46px;
  }

  .landing-hero {
    padding-top: 8px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 6.5vw, 2.3rem);
    line-height: 1.2;
    margin-bottom: 12px;
  }

  .hero-subtitle {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 22px;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    gap: 10px;
    margin-bottom: 22px;
  }

  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
    font-size: 0.95rem;
  }

  .hero-trust-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .trust-item {
    padding: 5px 10px;
    font-size: 0.76rem;
  }

  .mockup-frame {
    max-width: 100%;
    border-radius: var(--radius-md);
  }

  .mockup-topbar {
    padding: 10px 12px;
  }

  .mockup-avatar {
    width: 32px;
    height: 32px;
  }

  .mockup-name {
    font-size: 0.82rem;
  }

  .mockup-actions {
    gap: 6px;
  }

  .mockup-pill-badge {
    font-size: 0.68rem;
    padding: 3px 7px;
  }

  .mockup-pill-btn {
    font-size: 0.68rem;
    padding: 3px 8px;
  }

  .mockup-chat-stream {
    padding: 14px 10px;
    gap: 10px;
  }

  .mockup-bubble {
    max-width: 90%;
    font-size: 0.82rem;
    padding: 8px 11px;
  }

  .mockup-footer-bar {
    padding: 8px 10px;
    gap: 8px;
  }

  .mockup-input-mock {
    font-size: 0.74rem;
    padding: 6px 10px;
  }

  .landing-features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .feature-card {
    padding: 20px 18px;
  }

  .section-header {
    margin-bottom: 22px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .step-card {
    padding: 20px 18px;
  }

  .camps-badge-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .camp-badge-card {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .safety-card {
    flex-direction: column;
    padding: 20px 18px;
    gap: 14px;
  }

  .landing-cta-banner {
    padding: 32px 18px;
  }

  .landing-cta-banner h2 {
    font-size: 1.45rem;
  }

  .landing-cta-banner .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .main-wrapper {
    padding: 0;
    max-width: 100%;
  }

  .view-lobby {
    margin: auto 16px;
    padding: 28px 18px;
  }

  .view-searching {
    margin: auto 16px;
  }

  .view-chat {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .chat-topbar {
    padding: 10px 12px;
  }

  .peer-avatar-frame {
    width: 38px;
    height: 38px;
  }

  .peer-name {
    font-size: 0.9rem;
  }

  .chat-controls-group .btn-sm {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .chat-stream {
    padding: 10px 12px;
    gap: 6px;
  }

  .chat-composer {
    padding: 10px 12px;
    gap: 8px;
  }

  .input-field-chat {
    padding: 9px 40px 9px 14px;
    font-size: 0.9rem;
    height: 40px;
    line-height: 20px;
  }
}

/* Extra small mobile screens (<= 420px, e.g. iPhone SE / compact Android) */
@media (max-width: 420px) {
  .app-header {
    padding: 8px 10px;
  }

  .brand-wrap {
    gap: 6px;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
  }

  .brand-icon svg,
  .brand-icon i {
    width: 15px !important;
    height: 15px !important;
  }

  .brand-text {
    font-size: 0.98rem;
  }

  .btn-landing-login {
    padding: 5px 6px;
    font-size: 0.76rem;
  }

  .landing-header-actions .btn-sm {
    padding: 5px 8px;
    font-size: 0.76rem;
    gap: 3px;
  }

  .hero-title {
    font-size: 1.65rem;
  }

  .camps-badge-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Bottom Action Sheet (Messenger Style) */
.mobile-action-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.55);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: bubble-in 0.18s ease;
}

.mobile-action-sheet-overlay.hidden {
  display: none;
}

.mobile-action-sheet {
  background: #18191a;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.85);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  animation: slide-sheet-up 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-reactions-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
}

.sheet-react-opt {
  font-size: 1.6rem;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
}

.sheet-react-opt:active, .sheet-react-opt:hover {
  transform: scale(1.35) translateY(-3px);
}

.sheet-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
}

.sheet-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 12px;
  transition: transform 0.15s ease, background 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.sheet-action-item:hover, .sheet-action-item:active {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.06);
}

.sheet-action-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.sheet-action-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.sheet-action-item.danger .sheet-action-label,
.sheet-action-item.danger .sheet-action-icon {
  color: #f87171;
}

/* Copy Toast Feedback */
.chat-toast {
  position: fixed;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 10000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  animation: bubble-in 0.2s ease;
  pointer-events: none;
}

/* Auth Tabs & Form Enhancements */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.form-hint {
  display: block;
  font-size: 0.74rem;
  color: #94a3b8;
  margin-top: 6px;
  line-height: 1.4;
}

.auth-error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  animation: bubble-in 0.15s ease;
}

/* User Header Profile Badge - Whole Pill Clickable */
.user-header-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.user-header-pill:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  transform: translateY(-1px);
}

.user-header-pill:active {
  transform: scale(0.97);
}

/* SweetAlert2 Dark Mode Overrides */
.swal2-popup.swal2-dark-popup {
  background: #111625 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  color: #f8fafc !important;
  padding: 28px 24px !important;
}

.swal2-popup.swal2-dark-popup .swal2-title {
  color: #fff !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 1.45rem !important;
  font-weight: 700 !important;
}

.swal2-popup.swal2-dark-popup .swal2-html-container {
  color: #94a3b8 !important;
  font-size: 0.92rem !important;
  line-height: 1.6 !important;
}

.swal2-popup.swal2-dark-popup .swal2-actions {
  gap: 10px !important;
}

.swal2-popup.swal2-dark-popup .swal2-confirm {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border-radius: 999px !important;
  padding: 10px 22px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35) !important;
}

.swal2-popup.swal2-dark-popup .swal2-cancel {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border-radius: 999px !important;
  padding: 10px 22px !important;
  font-weight: 600 !important;
}

/* In-Chat Idle Match CTA Bar */
.chat-match-bar {
  flex-shrink: 0;
  padding: 12px 16px;
  background: rgba(11, 15, 25, 0.95);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 20;
}

.match-mode-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 3px;
  gap: 4px;
}

.match-mode-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.match-mode-pill:hover {
  color: #fff;
}

.match-mode-pill.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.btn-match-cta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* In-Chat Searching Bar */
.chat-searching-bar {
  flex-shrink: 0;
  padding: 12px 18px;
  background: rgba(11, 15, 25, 0.95);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
}

.radar-searching-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #38bdf8;
}

.mini-radar-pulse {
  width: 12px;
  height: 12px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
  animation: mini-radar-ring 1.4s infinite cubic-bezier(0.24, 0, 0.38, 1);
  flex-shrink: 0;
}

@keyframes mini-radar-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

@media (max-width: 560px) {
  .chat-match-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .match-mode-selector {
    justify-content: center;
  }
  .match-mode-pill {
    flex: 1;
    justify-content: center;
  }
}

/* NearGroup-Style Continuous Chat Stream Dividers */
.stream-divider {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  margin: 14px 0;
  font-size: 0.73rem;
  font-weight: 600;
  text-align: center;
  user-select: none;
}

.stream-divider::before,
.stream-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.stream-divider-content {
  background: rgba(18, 24, 38, 0.94);
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.stream-divider.match-start .stream-divider-content {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(12, 28, 48, 0.94);
}

.stream-divider.match-end .stream-divider-content {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   LANDING PAGE (Clean, Modern, Authentic Community Design)
   ========================================================================== */

.landing-page-wrapper {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background-color: var(--bg);
}

.landing-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

/* Landing Header Actions */
.landing-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-landing-login {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-landing-login:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.landing-header-actions .btn-sm {
  white-space: nowrap;
}

/* Modal Close Icon */
.modal-close-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

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

/* 1. Hero Section */
.landing-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 16px;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #fff;
  max-width: 760px;
  margin: 0 auto 18px;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
  max-width: 620px;
  margin: 0 auto 32px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: #e2e8f0;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.hero-trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-sub);
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 2. Authentic App Preview Mockup */
.landing-mockup-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mockup-frame {
  max-width: 540px;
  width: 100%;
  background: #0d121f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mockup-topbar {
  padding: 12px 18px;
  background: rgba(18, 24, 38, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mockup-peer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mockup-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
}

.mockup-avatar.blurred {
  filter: blur(6px);
}

.mockup-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
}

.mockup-camp {
  font-size: 0.72rem;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.mockup-pill-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mockup-pill-btn {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 4px 10px;
  border-radius: 999px;
}

.mockup-chat-stream {
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #090d16;
}

.mockup-divider {
  align-self: center;
  font-size: 0.7rem;
  color: #64748b;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mockup-bubble {
  max-width: 82%;
  padding: 10px 14px;
  font-size: 0.86rem;
  line-height: 1.45;
  border-radius: 16px;
  position: relative;
}

.mockup-bubble.in {
  align-self: flex-start;
  background: #192233;
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.mockup-bubble.out {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.mockup-reaction {
  position: absolute;
  bottom: -9px;
  right: 10px;
  background: #111625;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
}

.mockup-footer-bar {
  padding: 12px 16px;
  background: #0d121f;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.mockup-mode-chips {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 2px;
  font-size: 0.7rem;
  font-weight: 600;
}

.mockup-mode-chips span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #94a3b8;
}

.mockup-mode-chips span.active {
  background: var(--primary);
  color: #fff;
}

.mockup-input-mock {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.78rem;
  color: #64748b;
}

.mockup-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

/* 3. Feature Grid - Exactly 4 in 1 row on desktop, 2x2 on tablet, 1 column on mobile */
.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 992px) {
  .landing-features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .landing-features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.feature-card {
  background: rgba(17, 22, 37, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px 18px;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(20, 26, 45, 0.8);
  transform: translateY(-2px);
}

.feature-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(79, 70, 229, 0.12);
  border: 1px solid rgba(79, 70, 229, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  margin-bottom: 16px;
}

.feature-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

/* 4. Section Header & Steps */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 36px;
}

.section-tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.step-card {
  background: rgba(17, 22, 37, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  position: relative;
}

.step-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: rgba(99, 102, 241, 0.35);
  margin-bottom: 12px;
}

.step-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* 5. Camps Badges - Perfectly Equal Distribution (3x2 on desktop/tablet, 2x3 on mobile) */
.camps-badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .camps-badge-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

@media (max-width: 360px) {
  .camps-badge-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.camp-badge-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #e2e8f0;
  transition: all 0.2s ease;
}

.camp-badge-card:hover {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.3);
  color: #fff;
}

.camp-badge-card i {
  color: var(--accent);
}

/* 6. Safety Card */
.safety-card {
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.safety-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(79, 70, 229, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  flex-shrink: 0;
}

.safety-content h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.safety-content p {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.6;
}

.safety-content strong {
  color: #cbd5e1;
}

/* 7. CTA Banner */
.landing-cta-banner {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.16) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(79, 70, 229, 0.3);
  border-radius: var(--radius-lg);
  padding: 44px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-cta-banner h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.landing-cta-banner p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  max-width: 480px;
}

/* 8. Footer */
.landing-footer {
  border-top: 1px solid var(--card-border);
  padding-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand p {
  font-size: 0.82rem;
  color: var(--text-sub);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.5;
}

/* Google AdSense Responsive Layout Slots */
.desktop-side-rail {
  display: none;
  width: 160px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  align-self: center;
}

@media (min-width: 1240px) {
  .main-wrapper {
    max-width: 1140px;
    height: calc(100vh - 75px);
    margin: 0 auto;
    flex-direction: row !important;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
  }
  .main-wrapper[style*="display: none"],
  .main-wrapper.hidden {
    display: none !important;
  }
  .desktop-side-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}

.side-rail-ad-box {
  width: 160px;
  min-height: 600px;
  background: rgba(17, 22, 37, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 0;
  overflow: hidden;
}

.ad-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 600;
}

.landing-ad-slot {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Searching State Waiting Ad Card (Option B) */
.search-waiting-ad {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 10px 14px;
  width: 100%;
  animation: waitingAdFadeIn 0.25s ease;
}

.waiting-ad-box {
  width: 100%;
  max-width: 320px;
  min-height: 250px;
  background: rgba(17, 22, 37, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

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

/* Content Page Layout with Desktop Side Rails */
.content-page-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 16px;
}

.content-page-layout .desktop-side-rail {
  display: none;
  width: 160px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  align-self: flex-start;
}

@media (min-width: 1240px) {
  .content-page-layout .desktop-side-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}
