:root {
  --bg: #000000;
  --bg-2: #0a0a0a;
  --surface: #1a1a1a;
  --surface-2: #262626;
  --border: #2a2a2a;
  --text: #ffffff;
  --text-2: #a8a8a8;
  --text-3: #6b6b6b;
  --yellow: #FF3B30;
  --blue: #FF3B30;
  --pink: #FF3B30;
  --green: #FF3B30;
  --red: #FF3B30;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 68px;
  --top-h: 75px;
  --side-w: 80px;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  background: var(--bg);
}

/* Top bar */
.top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 30;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}
.top-left, .top-right, .top-center { display: flex; align-items: center; gap: 6px; }
.top-center { flex: 1; justify-content: center; }
.snap-logo svg { width: 34px; height: 34px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }

.icon-btn {
  width: 40px; height: 40px;
  border: none; background: transparent;
  color: var(--text);
  display: grid; place-items: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { background: rgba(255,255,255,0.12); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 22px; height: 22px; }

.avatar-btn {
  width: 36px; height: 36px;
  border: none; background: transparent;
  cursor: pointer; padding: 0;
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF3B30, #8B0000);
  display: grid; place-items: center;
  font-weight: 700; color: #000;
  font-size: 14px;
  border: 2px solid #fff;
}
.language-picker { display: inline-flex; align-items: center; }
.language-picker select, .auth-language-picker select {
  min-width: 72px; max-width: 112px; padding: 7px 26px 7px 9px;
  border: 1px solid var(--border); border-radius: 18px;
  color: var(--text); background: rgba(20,20,20,0.88); font: inherit; font-size: 12px;
}
.auth-language-picker { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--text-2); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Main top nav */
.main-nav {
  position: absolute;
  top: var(--top-h);
  left: 0; right: 0;
  height: 52px;
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 35;
  padding: 0 4px;
}
.main-nav .nav-item { color: var(--text-2); }
.main-nav .nav-item.active { color: var(--yellow); }

/* hide old navs */
.bottom-nav { display: none !important; }
.side-nav { display: none !important; }

/* Screens container */
#screens {
  position: absolute;
  inset: 0;
}
.screen {
  position: absolute;
  inset: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(var(--top-h) + 52px);
  padding-bottom: env(safe-area-inset-bottom);
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.screen::-webkit-scrollbar { width: 0; }

/* Camera screen */
.screen-camera { background: #000; }
.camera-view { position: absolute; inset: 0; }
.camera-placeholder {
  position: absolute; inset: 0;
  background: url('/error_803.png') center center/cover no-repeat #000;
}
.camera-gradient {
  position: absolute; inset: 0;
  background: none;
}
.camera-grid {
  position: absolute; inset: 0;
  background: none;
}
.lens-chip {
  position: absolute; top: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
  padding: 6px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.15);
}

.side-tools {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 18px;
  z-index: 5;
}
.tool-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: transparent; border: none; color: #fff;
  cursor: pointer; font-size: 11px; font-weight: 500;
  transition: transform 0.15s ease;
}
.tool-btn:active { transform: scale(0.9); }
.tool-btn svg { width: 24px; height: 24px; }

.capture-area {
  position: absolute;
  bottom: 24px;
  left: 0; right: 0;
  display: flex; align-items: center; justify-content: center; gap: 40px;
  z-index: 5;
}
.capture-side-btn {
  width: 44px; height: 44px;
  border: none; background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  color: #fff; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.capture-side-btn:hover { background: rgba(255,255,255,0.2); }
.capture-side-btn:active { transform: scale(0.9); }
.capture-side-btn svg { width: 22px; height: 22px; }

/* Flash and flip camera only visible while taking a picture */
#flashBtn, #flipBtn { display: none; }
#flashBtn.visible, #flipBtn.visible { display: flex; }

.capture-btn {
  width: 80px; height: 80px;
  border: none; background: transparent;
  cursor: pointer; position: relative;
  display: grid; place-items: center;
}
.capture-ring {
  position: absolute; inset: 0;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
}
.capture-inner {
  width: 62px; height: 62px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease, background 0.15s ease;
}
.capture-btn:active .capture-inner { transform: scale(0.85); background: #e0e0e0; }

.lens-carousel {
  position: absolute;
  bottom: 110px;
  left: 0; right: 0;
  display: flex; gap: 12px; justify-content: center;
  z-index: 5;
}
.lens-item {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  font-size: 22px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.lens-item.active { border-color: var(--yellow); transform: scale(1.1); }
.lens-item:hover { transform: scale(1.05); }

/* Generic screen styles */
.screen-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px;
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 10;
}
.screen-header h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.header-actions { display: flex; gap: 4px; }

.search-bar {
  margin: 8px 16px 12px;
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-2);
}
.search-bar input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px; font-family: var(--font);
}
.search-bar input::placeholder { color: var(--text-3); }
.search-bar svg { width: 18px; height: 18px; }

.list { padding: 0 8px; }
.section-label {
  padding: 16px 8px 8px;
  font-size: 13px; font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.chat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.chat-item:hover { background: var(--surface); }
.avatar-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF3B30, #8B0000);
  display: grid; place-items: center;
  font-weight: 700; color: #000; font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-circle.blue { background: linear-gradient(135deg, #FF3B30, #0066ff); color: #fff; }
.avatar-circle.green { background: linear-gradient(135deg, #00D66F, #00a854); color: #fff; }
.avatar-circle.pink { background: linear-gradient(135deg, #8B0000, #ff3ba8); color: #fff; }
.avatar-circle.group { background: var(--surface-2); font-size: 20px; overflow: hidden; }
.avatar-circle.small { width: 32px; height: 32px; font-size: 13px; overflow: hidden; }
.avatar, .profile-avatar-big { overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-initial { display: grid; place-items: center; width: 100%; height: 100%; }
.chat-info { flex: 1; min-width: 0; }
.chat-name { font-weight: 600; font-size: 15px; }
.chat-preview { font-size: 13px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: 12px; color: var(--text-3); }

.bottom-cta { padding: 16px; }
.pill-btn {
  background: var(--yellow); color: #000;
  border: none; border-radius: 24px;
  padding: 12px 24px; font-weight: 700; font-size: 15px;
  cursor: pointer; width: 100%;
  transition: transform 0.15s ease, opacity 0.15s ease;
  font-family: var(--font);
}
.pill-btn:hover { opacity: 0.9; }
.pill-btn:active { transform: scale(0.98); }
.pill-btn.outline {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}

/* Stories screen */
.stories-row {
  display: flex; gap: 14px; padding: 12px 16px;
  overflow-x: auto; scrollbar-width: none;
}
.stories-row::-webkit-scrollbar { display: none; }
.story-bubble { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; }
.story-ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF3B30, #8B0000, #FF3B30);
  padding: 3px;
  display: grid; place-items: center;
}
.story-ring.viewed { background: var(--surface-2); }
.story-ring span {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg);
  display: grid; place-items: center;
  font-weight: 700; font-size: 20px;
}
.story-bubble.me .story-ring span { background: var(--surface); font-size: 28px; color: var(--yellow); }
.story-name { font-size: 12px; color: var(--text-2); max-width: 64px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.discover-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 16px 16px;
}
.discover-tile {
  aspect-ratio: 9/16;
  border-radius: 14px;
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}
.discover-tile:hover { transform: scale(1.02); }
.discover-tile .tile-label {
  position: absolute; bottom: 12px; left: 12px;
  font-weight: 700; font-size: 14px;
}
.discover-tile .tile-sub { font-size: 12px; color: rgba(255,255,255,0.8); margin-top: 2px; }
.tile-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.tile-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.tile-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.tile-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.tile-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.tile-6 { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }

/* Spotlight */
.screen-spotlight { background: #000; padding: 0; }
.spotlight-feed {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  scroll-snap-type: y mandatory; overscroll-behavior: contain;
  scrollbar-width: none;
}
.spotlight-feed::-webkit-scrollbar { display: none; }
.spotlight-card { position: relative; width: 100%; height: 100%; min-height: 100%; flex: 0 0 100%; scroll-snap-align: start; }
.spotlight-bg { position: absolute; inset: 0; }
.bg1 { background: linear-gradient(135deg, #2c3e50 0%, #4ca1af 50%, #2c3e50 100%); }
.spotlight-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px 16px calc(var(--nav-h) + 20px);
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
}
.spotlight-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 16px; z-index: 5;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}
.spotlight-top h2 { font-size: 20px; font-weight: 700; }
.spotlight-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.spotlight-user span { font-weight: 600; font-size: 15px; }
.follow-btn {
  background: var(--yellow); color: #000;
  border: none; border-radius: 20px;
  padding: 6px 16px; font-weight: 700; font-size: 13px;
  cursor: pointer; margin-left: auto;
}
.spotlight-caption { font-size: 15px; margin-bottom: 14px; line-height: 1.4; }
.spotlight-actions {
  display: flex; gap: 20px; justify-content: flex-end;
  position: absolute; right: 12px; bottom: 60px;
  flex-direction: column; align-items: center;
}
.sp-action {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: transparent; border: none; color: #fff;
  cursor: pointer; font-size: 12px; font-weight: 600;
}
.sp-action svg { width: 28px; height: 28px; }
.sp-action:active { transform: scale(0.9); }

/* Map */
.screen-map { background: #0b1a2b; padding: 0; }
.map-view { position: absolute; inset: 0; }
.map-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, #1e3a5f 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, #2a4a6f 0%, transparent 40%),
    linear-gradient(135deg, #0b1a2b 0%, #152840 100%);
}
.map-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.map-pin {
  position: absolute; transform: translate(-50%, -100%);
  cursor: pointer;
}
.pin-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #FF3B30, #8B0000);
  display: grid; place-items: center; font-weight: 700; color: #000;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.pin-avatar.blue { background: linear-gradient(135deg, #FF3B30, #0066ff); color: #fff; }
.pin-avatar.green { background: linear-gradient(135deg, #00D66F, #00a854); color: #fff; }
.map-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; z-index: 5;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}
.map-top h2 { font-size: 20px; font-weight: 700; }
.map-bottom {
  position: absolute; bottom: 16px; left: 16px; right: 16px;
  z-index: 5;
}
.map-card {
  background: rgba(0,0,0,0.6); backdrop-filter: blur(12px);
  border-radius: 14px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}
.map-card-title { font-weight: 600; font-size: 14px; }
.map-card-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Profile */
.screen-profile { background: var(--bg); }
.profile-header {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px 16px; text-align: center;
}
.profile-avatar-big {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, #FF3B30, #8B0000);
  display: grid; place-items: center;
  font-weight: 800; font-size: 40px; color: #000;
  border: 3px solid #fff;
  margin-bottom: 12px;
}
.profile-header h2 { font-size: 22px; font-weight: 800; }
.profile-handle { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.profile-stats {
  display: flex; gap: 32px; margin: 20px 0;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat strong { font-size: 20px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.profile-actions { display: flex; gap: 10px; width: 100%; max-width: 320px; }
.profile-actions .pill-btn { flex: 1; }
.profile-section { padding: 8px 16px; }
.profile-spotlight-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.profile-spotlight-item { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px; background: var(--surface); border-radius: 12px; }
.profile-spotlight-preview { width: 76px; height: 56px; flex: 0 0 76px; object-fit: cover; border-radius: 8px; background: #000; }
.profile-spotlight-caption { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.profile-spotlight-item .pill-btn { flex: 0 0 auto; padding: 7px 14px; }
.blocked-people-list { margin: 8px 0; }
.blocked-empty { padding: 14px 2px; color: var(--text-2); font-size: 14px; }
.blocked-person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.blocked-person-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.blocked-person-info strong { font-size: 14px; }
.blocked-person-info span { color: var(--text-2); font-size: 12px; }
.blocked-person .pill-btn { flex: 0 0 auto; padding: 7px 14px; }
#blockPersonBtn { width: 100%; margin-top: 8px; }
.empty-state {
  background: var(--surface); border-radius: 14px;
  padding: 32px 16px; text-align: center;
  color: var(--text-2);
}
.empty-state svg { width: 40px; height: 40px; margin-bottom: 8px; opacity: 0.6; }
.empty-state p { font-size: 14px; }
.profile-settings { padding: 8px 16px 24px; }
.settings-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}
.settings-item:hover { background: var(--surface); border-radius: 8px; }
.settings-item svg:first-child { width: 22px; height: 22px; color: var(--text-2); }
.settings-item span { flex: 1; font-weight: 500; }
.settings-item .chev { width: 18px; height: 18px; color: var(--text-3); }

/* Bottom nav (mobile) */
.bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 40;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: transparent; border: none; color: var(--text-2);
  cursor: pointer; font-size: 10px; font-weight: 600;
  padding: 6px 8px; border-radius: 8px;
  transition: color 0.15s ease, transform 0.15s ease;
  font-family: var(--font);
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--yellow); }
.nav-item:active { transform: scale(0.9); }

/* Side nav (desktop) */
.side-nav {
  display: none;
  width: var(--side-w);
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  z-index: 40;
}
.side-logo { margin-bottom: 16px; }
.side-logo svg { width: 36px; height: 36px; }
.side-nav-item {
  width: 64px; height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: transparent; border: none; color: var(--text-2);
  cursor: pointer; font-size: 10px; font-weight: 600;
  border-radius: 12px;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: var(--font);
}
.side-nav-item svg { width: 22px; height: 22px; }
.side-nav-item:hover { background: var(--surface); }
.side-nav-item.active { color: var(--yellow); background: rgba(255,59,48,0.08); }
.side-nav-bottom { margin-top: auto; }

/* Desktop layout */
@media (min-width: 768px) {
  .side-nav { display: none !important; }
  .bottom-nav { display: none !important; }
  #app { flex-direction: row; }
  #screens { position: relative; flex: 1; }
  .screen {
    padding-top: calc(var(--top-h) + 52px);
    padding-bottom: 0;
  }
  .capture-area { bottom: 24px; }
  .lens-carousel { bottom: 110px; }
  .spotlight-actions { bottom: 60px; }
  .map-bottom { bottom: 16px; }
}

/* Tablet */
@media (min-width: 600px) and (max-width: 767px) {
  .discover-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Large desktop */
@media (min-width: 1200px) {
  .discover-grid { grid-template-columns: repeat(4, 1fr); }
  .side-nav { width: 96px; }
}

.text-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  display: none;
  flex-direction: column; align-items: center; gap: 8px;
}
.text-overlay.show { display: flex; }
.text-overlay input {
  background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff; font-size: 24px; font-weight: 700;
  text-align: center; padding: 10px 16px;
  border-radius: 12px; outline: none;
  font-family: var(--font);
  min-width: 220px;
}
.text-overlay input::placeholder { color: rgba(255,255,255,0.5); font-weight: 500; font-size: 16px; }
.text-overlay-hint { font-size: 12px; color: rgba(255,255,255,0.6); }

.camera-text {
  position: absolute;
  font-size: 28px; font-weight: 800;
  color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  cursor: move; z-index: 6;
  padding: 4px 8px;
}
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(255,255,255,0.15); backdrop-filter: blur(12px);
  color: #fff; padding: 10px 20px; border-radius: 24px;
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Utility */
.hidden { display: none !important; }

/* ---------- Snap System ---------- */
.snap-tool-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: transparent; border: none; color: #fff; cursor: pointer;
  font-size: 11px; font-weight: 500; padding: 6px; border-radius: 8px;
}
.snap-tool-btn:active { background: rgba(255,255,255,0.15); }
.snap-tool-btn svg { width: 22px; height: 22px; }

.snap-text-overlay {
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.chat-item.snap-item {
  animation: snapPulse 0.4s ease;
}
@keyframes snapPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Responsive: snap editor on small screens */
@media (max-width: 480px) {
  .snap-tool-btn span { display: none; }
  .snap-tool-btn svg { width: 20px; height: 20px; }
}

/* ---------- Message media (images/videos) ---------- */
.message-media {
  margin-top: 6px;
  border-radius: 12px;
  overflow: hidden;
  max-width: 200px;
  max-height: 200px;
  background: #111;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.message-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.message-media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Sticker rendering ---------- */
.sticker {
  display: inline-block;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
}
.sticker img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sticker.normal { font-size: 1.5em; line-height: 1; }
.sticker.big { font-size: 3.5em; line-height: 1; }

/* ---------- Emoji / sticker reactions ---------- */
.message-reactions {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
}
.reaction-bubble {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 16px;
  background: rgba(255,59,48,0.15); border: 1px solid rgba(255,59,48,0.35);
  color: #fff; font-size: 12px; cursor: pointer;
}
.reaction-bubble .reaction-emoji { font-size: 14px; }
.reaction-bubble .reaction-count { font-weight: 700; font-size: 11px; }
.reaction-bubble.self { background: rgba(255,59,48,0.35); border-color: rgba(255,59,48,0.6); }

/* ---------- Emoji/sticker picker modal ---------- */
.picker-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px;
  padding: 12px; max-height: 300px; overflow-y: auto;
}
.picker-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px; border-radius: 10px; cursor: pointer;
  background: transparent; border: none; color: #fff; font-size: 24px;
}
.picker-item:hover { background: rgba(255,255,255,0.1); }
.picker-item.selected { background: rgba(255,59,48,0.25); border: 1px solid #FF3B30; }
.picker-label { font-size: 10px; }

/* ---------- Media button in chat input ---------- */
.input-tools { display: flex; align-items: center; gap: 6px; }


/* From Uiverse.io by mobinkakei */
.wrapper {
  width: 200px;
  height: 60px;
  position: relative;
  z-index: 1;
}

.circle {
  width: 20px;
  height: 20px;
  position: absolute;
  border-radius: 50%;
  background-color: #fff;
  left: 15%;
  transform-origin: 50%;
  animation: circle7124 .5s alternate infinite ease;
}

@keyframes circle7124 {
  0% {
    top: 60px;
    height: 5px;
    border-radius: 50px 50px 25px 25px;
    transform: scaleX(1.7);
  }

  40% {
    height: 20px;
    border-radius: 50%;
    transform: scaleX(1);
  }

  100% {
    top: 0%;
  }
}

.circle:nth-child(2) {
  left: 45%;
  animation-delay: .2s;
}

.circle:nth-child(3) {
  left: auto;
  right: 15%;
  animation-delay: .3s;
}

.shadow {
  width: 20px;
  height: 4px;
  border-radius: 50%;
  background-color: rgba(0,0,0,0.9);
  position: absolute;
  top: 62px;
  transform-origin: 50%;
  z-index: -1;
  left: 15%;
  filter: blur(1px);
  animation: shadow046 .5s alternate infinite ease;
}

@keyframes shadow046 {
  0% {
    transform: scaleX(1.5);
  }

  40% {
    transform: scaleX(1);
    opacity: .7;
  }

  100% {
    transform: scaleX(.2);
    opacity: .4;
  }
}

.shadow:nth-child(4) {
  left: 45%;
  animation-delay: .2s
}

.shadow:nth-child(5) {
  left: auto;
  right: 15%;
  animation-delay: .3s;
}

#appLoading {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* From Uiverse.io by barisdogansutcu */
.love-heart:before,#switch {
 display: none;
}

.love-heart, .love-heart::after {
 border-color: hsl(231deg 28% 86%);
 border: 1px solid;
 border-top-left-radius: 100px;
 border-top-right-radius: 100px;
 width: 10px;
 height: 8px;
 border-bottom: 0
}

.round {
 position: absolute;
 z-index: 1;
 width: 8px;
 height: 8px;
 background: hsl(0deg 0% 100%);
 box-shadow: rgb(0 0 0 / 24%) 0px 0px 4px 0px;
 border-radius: 100%;
 left: 0px;
 bottom: -1px;
 transition: all .5s ease;
 animation: check-animation2 .5s forwards;
}

input:checked + label .round {
 transform: translate(0px, 0px);
 animation: check-animation .5s forwards;
 background-color: hsl(0deg 0% 100%);
}

@keyframes check-animation {
 0% {
  transform: translate(0px, 0px);
 }

 50% {
  transform: translate(0px, 7px);
 }

 100% {
  transform: translate(7px, 7px);
 }
}

@keyframes check-animation2 {
 0% {
  transform: translate(7px, 7px);
 }

 50% {
  transform: translate(0px, 7px);
 }

 100% {
  transform: translate(0px, 0px);
 }
}

.love-heart {
 box-sizing: border-box;
 position: relative;
 transform: rotate(-45deg) translate(-50%, -33px) scale(4);
 display: block;
 border-color: hsl(231deg 28% 86%);
 cursor: pointer;
 top: 0;
}

input:checked + .love-heart, input:checked + .love-heart::after, input:checked + .love-heart .bottom {
 border-color: hsl(347deg 81% 61%);
 box-shadow: inset 6px -5px 0px 2px hsl(347deg 99% 72%);
}

.love-heart::after, .love-heart .bottom {
 content: "";
 display: block;
 box-sizing: border-box;
 position: absolute;
 border-color: hsl(231deg 28% 86%);
}

.love-heart::after {
 right: -9px;
 transform: rotate(90deg);
 top: 7px;
}

.love-heart .bottom {
 width: 11px;
 height: 11px;
 border-left: 1px solid;
 border-bottom: 1px solid;
 border-color: hsl(231deg 28% 86%);
 left: -1px;
 top: 5px;
 border-radius: 0px 0px 0px 5px;
}

/* From Uiverse.io by adamgiebl */
.send-uiverse {
  font-family: inherit;
  font-size: 20px;
  background: #000;
  color: #fff;
  padding: 0.7em 1em;
  padding-left: 0.9em;
  display: flex;
  align-items: center;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}

.send-uiverse span {
  display: block;
  margin-left: 0.3em;
  transition: all 0.3s ease-in-out;
}

.send-uiverse svg {
  display: block;
  transform-origin: center center;
  transition: transform 0.3s ease-in-out;
}

.send-uiverse:hover .svg-wrapper {
  animation: fly-1 0.6s ease-in-out infinite alternate;
}

.send-uiverse:hover svg {
  transform: translateX(1.2em) rotate(45deg) scale(1.1);
}

.send-uiverse:hover span {
  transform: translateX(5em);
}

.send-uiverse:active {
  transform: scale(0.95);
}

@keyframes fly-1 {
  from {
    transform: translateY(0.1em);
  }

  to {
    transform: translateY(-0.1em);
  }
}
.love { transform: translateX(-12px); }


/* Uiverse-inspired auth button */
.uiverse-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 0;
  position: relative;
  overflow: hidden;
  border-radius: 10rem;
  transition: all 0.2s;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  background: #FF3B30;
  z-index: 0;
  box-shadow: 0 0px 7px -5px rgba(0,0,0,0.5);
  width: 100%;
  margin-top: 8px;
}
.uiverse-auth:hover {
  background: #ff5a50;
  color: #000;
}
.uiverse-auth:active {
  transform: scale(0.97);
}


/* From Uiverse.io by vinodjangid07 */
.uiverse-delete {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgb(20, 20, 20);
  border: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.164);
  cursor: pointer;
  transition-duration: .3s;
  overflow: hidden;
  position: relative;
  transform: scale(0.45);
  padding: 0;
}
.uiverse-delete .svgIcon {
  width: 12px;
  transition-duration: .3s;
}
.uiverse-delete .svgIcon path {
  fill: white;
}
.uiverse-delete:hover {
  width: 140px;
  border-radius: 50px;
  transition-duration: .3s;
  background-color: rgb(255, 69, 69);
  align-items: center;
}
.uiverse-delete:hover .svgIcon {
  width: 50px;
  transition-duration: .3s;
  transform: translateY(60%);
}
.uiverse-delete::before {
  position: absolute;
  top: -20px;
  content: "Delete";
  color: white;
  transition-duration: .3s;
  font-size: 2px;
}
.uiverse-delete:hover::before {
  font-size: 13px;
  opacity: 1;
  transform: translateY(30px);
  transition-duration: .3s;
}


/* Home page */
.home-wrap { min-height:100vh; display:flex; flex-direction:column; background:#000; color:#fff; font-family:Inter,sans-serif; }
.home-main { flex:1; padding:24px; max-width:800px; margin:0 auto; width:100%; box-sizing:border-box; }
.home-main h2 { color:#fff; }
.home-main ul { line-height:1.8; }
.home-footer { text-align:center; padding:24px; color:#aaa; font-size:12px; border-top:1px solid #222; }
.home-footer a { color:#FF3B30; text-decoration:none; }
