/* Modern Omegle Web App - Dark Glassmorphism Design System */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 36, 56, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-glow: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --accent-cyan: #06b6d4;
  --accent-pink: #e100ff;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --vip-gold: #fbbf24;
  --vip-gradient: linear-gradient(135deg, #f59e0b, #e100ff, #8b5cf6);
  
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 25px rgba(225, 0, 255, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  background-color: #070a12;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Subtle, Slow-Animating Custom Ambient Aurora Glow */
body::before {
  content: '';
  position: fixed;
  inset: -40%;
  width: 180%;
  height: 180%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(225, 0, 255, 0.14) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 75% 65%, rgba(139, 92, 246, 0.12) 0%, transparent 45%);
  filter: blur(80px);
  animation: subtleAurora 24s ease-in-out infinite alternate;
  z-index: -1;
  pointer-events: none;
}

@keyframes subtleAurora {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  33% {
    transform: translate(-3%, 4%) scale(1.08) rotate(3deg);
  }
  66% {
    transform: translate(4%, -2%) scale(1.04) rotate(-2deg);
  }
  100% {
    transform: translate(-2%, -4%) scale(1.1) rotate(4deg);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

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

.online-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

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

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-pro {
  background: var(--vip-gradient);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.825rem;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.25);
  transition: var(--transition);
}

.btn-pro.disabled {
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.65;
}

.btn-pro.disabled:hover {
  transform: none;
  box-shadow: none;
}

.vip-badge-tag {
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
}

/* App Main Container */
.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  min-height: calc(100vh - 65px);
  height: auto;
}

/* Landing / Matchmaking Lobby Screen */
.lobby-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 16px 60px 16px;
  animation: fadeIn 0.4s ease-out;
}

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

.hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero-title span {
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 10px auto 0 auto;
  text-align: center;
}

/* Tags Card */
.lobby-card {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  text-align: left;
  transition: var(--transition);
}

.lobby-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.12);
}

.card-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tag-input-wrapper {
  display: flex;
  gap: 8px;
  background: rgba(12, 17, 29, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  transition: var(--transition);
}

.tag-input-wrapper:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.tag-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  background: rgba(15, 23, 42, 0.95);
}

.tag-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  outline: none;
  font-size: 0.95rem;
}

.btn-add-tag {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-tag:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  min-height: 38px;
}

.tag-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.tag-chip:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.tag-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 12px var(--primary-glow);
}

.tag-remove {
  font-size: 0.9rem;
  opacity: 0.7;
  cursor: pointer;
}
.tag-remove:hover { opacity: 1; }

.suggested-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.suggested-chip:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Filter Controls in Lobby */
.lobby-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.filter-box {
  background: rgba(12, 17, 29, 0.8);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  cursor: pointer;
}

.filter-box:hover {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(18, 26, 44, 0.9);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.15);
  transform: translateY(-1px);
}

.filter-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.select-custom {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  outline: none;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.select-custom:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.select-custom option {
  background: #0f172a;
  color: #fff;
  padding: 8px;
}

.lock-icon-pro {
  color: var(--vip-gold);
  font-size: 0.75rem;
}

/* Mode Selection Action Buttons */
.mode-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

/* Entrance & Micro Animation Keyframes */
@keyframes cardScaleIn {
  from { opacity: 0; transform: scale(0.97) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.lobby-card {
  animation: cardScaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-mode {
  padding: 18px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  animation: cardScaleIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-mode:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--primary);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
}

.btn-mode:hover .mode-icon {
  transform: scale(1.12) rotate(4deg);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.btn-mode.text-mode-btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.25);
}

.btn-mode.video-mode-btn:hover {
  border-color: var(--accent-pink);
  box-shadow: 0 10px 30px rgba(225, 0, 255, 0.25);
}

.mode-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition);
}

.btn-mode.text-mode-btn .mode-icon {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.btn-mode.video-mode-btn .mode-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.mode-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.mode-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}



/* ACTIVE CHAT WORKSPACE */
body.chat-mode-active {
  overflow: hidden !important;
  height: 100dvh !important;
}

body.chat-mode-active .app-container {
  height: calc(100dvh - 61px) !important;
  max-height: calc(100dvh - 61px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.chat-screen {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

.chat-screen.video-active {
  grid-template-columns: 1.2fr 1fr;
}

/* Video Stage */
.video-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.video-grid {
  flex: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  height: calc(100% - 52px);
  max-height: calc(100% - 52px);
  min-height: 0;
  overflow: hidden;
}

.video-card {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  min-height: 0;
}

.video-card video, .video-card canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay-info {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
}

.peer-avatar-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

.peer-avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
}

/* Video Toolbar */
.video-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.btn-ctrl {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-ctrl.off {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.4);
}

/* Messaging Area */
.chat-area {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.chat-header-bar {
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.peer-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-match-badge {
  font-size: 0.7rem;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

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

.btn-action-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-action-icon.danger:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
}

/* Messages Stream */
.messages-box {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sys-message {
  align-self: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 85%;
}

.sys-message.encrypted {
  border-color: rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.08);
}

.msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
  animation: popIn 0.2s ease-out;
}

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

.msg-bubble.stranger {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  border-bottom-left-radius: 2px;
}

.msg-bubble.you {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.msg-bubble.you.vip-style {
  background: var(--vip-gradient);
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.msg-meta {
  font-size: 0.68rem;
  margin-top: 4px;
  opacity: 0.7;
  text-align: right;
}

.msg-flagged {
  font-style: italic;
  opacity: 0.8;
  filter: blur(3px);
  transition: filter 0.3s;
  cursor: pointer;
}
.msg-flagged:hover {
  filter: blur(0);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: var(--radius-pill);
  width: fit-content;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dot-flashing {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dotFlash 1s infinite alternate;
}
.dot-flashing:nth-child(2) { animation-delay: 0.2s; }
.dot-flashing:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotFlash {
  0% { opacity: 0.2; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

/* Chat Input Footer Controls */
.chat-footer {
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-skip {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-skip:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.45);
}

.btn-skip.new-match {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.input-box-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 4px 8px 4px 14px;
}

.input-box-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  outline: none;
  font-size: 0.925rem;
  padding: 8px 0;
}

.btn-send {
  background: var(--primary);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-send:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--glass-border-glow);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,0.2); }

.modal-header-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--vip-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  margin: 0 auto 16px;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.4);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
}

.modal-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 20px;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  background: rgba(30, 41, 59, 0.6);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.feature-icon {
  color: var(--accent-emerald);
}

.price-tag {
  text-align: center;
  margin-bottom: 20px;
}

.price-val {
  font-size: 2.25rem;
  font-weight: 900;
  color: #fff;
}

.price-val span {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-checkout {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--vip-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
  transition: var(--transition);
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.6);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive Rules for Mobile & Small Screens */
@media (max-width: 900px) {
  .app-container {
    padding: 8px;
    min-height: calc(100dvh - 56px);
    height: auto;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .lobby-filters {
    grid-template-columns: 1fr;
  }
  
  .mode-actions {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .chat-screen.video-active {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 8px;
    height: 100%;
    overflow: hidden;
  }

  .video-stage {
    height: 180px;
    max-height: 180px;
    min-height: 180px;
  }

  .video-grid {
    grid-template-rows: 1fr;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    height: 100%;
  }

  .chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .messages-box {
    flex: 1;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .chat-footer {
    flex-shrink: 0;
  }

  .video-card video, .video-card canvas {
    object-fit: cover;
  }
  
  .msg-bubble {
    max-width: 92%;
  }

  .video-controls-bar {
    padding: 4px 10px;
    gap: 6px;
  }

  .btn-ctrl {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }
}

/* Compact Mobile Viewports (Phones) */
@media (max-width: 600px) {
  html, body {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100% !important;
  }

  .app-container {
    height: auto !important;
    min-height: 100% !important;
    padding: 6px;
    overflow-y: visible !important;
  }

  .lobby-screen {
    justify-content: flex-start;
    gap: 12px;
    padding: 6px 4px 50px 4px;
    height: auto !important;
    overflow-y: visible !important;
  }

  .hero-title {
    font-size: 1.35rem;
    line-height: 1.15;
    margin-top: 4px;
  }

  .hero-sub {
    font-size: 0.8rem;
    margin-top: 4px;
  }

  .lobby-card {
    padding: 12px 10px;
    gap: 8px;
  }

  .tag-input-wrapper {
    flex-direction: row;
    padding: 6px 10px;
  }

  .tag-input {
    font-size: 0.8rem;
  }

  .btn-add-tag {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .mode-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 2px;
  }

  .btn-mode {
    padding: 12px 8px;
    gap: 4px;
  }

  .mode-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
    margin-bottom: 2px;
  }

  .mode-title {
    font-size: 0.9rem;
    font-weight: 700;
  }

  .mode-desc {
    font-size: 0.68rem;
  }

  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    font-size: 0.8rem;
    padding: 10px 14px;
  }
}
