/* =============================================
   Yala Bobo - Global Styles
   Dark Glassmorphism Design
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Readex+Pro:wght@300;400;500;600;700&display=swap');

:root {
  /* Nav specifics */
  --nav-height: 72px;
  --nav-safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-bg: var(--bg-main);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', 'Readex Pro', sans-serif;
  background: var(--bg-main);
  color: var(--text-1);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.en { direction: ltr; font-family: 'Readex Pro', sans-serif; }

/* Background Gradient — Tango Purple/Pink subtle ambient */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 10% 10%, rgba(107, 46, 229, 0.04) 0%, transparent 40%),
              radial-gradient(circle at 90% 90%, rgba(233, 64, 122, 0.04) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* =============================================
   Typography
   ============================================= */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; }
a { text-decoration: none; color: inherit; }
input, textarea, select, button { font-family: inherit; }
img { max-width: 100%; height: auto; }

/* =============================================
   Layout
   ============================================= */
.app-wrapper {
  /* Sizing controlled by responsive.css per breakpoint */
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.page-content {
  padding-bottom: calc(var(--nav-height) + var(--nav-safe-bottom) + 16px);
  min-height: 100vh;
  background: transparent;
  /* Border / radius applied at desktop breakpoint in responsive.css */
}

/* Deletion Animation */
@keyframes fadeOutDelete {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.5; filter: grayscale(1); }
    100% { transform: scale(0.8); opacity: 0; filter: grayscale(1); }
}
.deleting {
    animation: fadeOutDelete 0.5s forwards;
    pointer-events: none;
}

.page-content.no-nav { padding-bottom: 0; }

/* =============================================
   Bottom Navigation
   ============================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  min-height: var(--nav-height);
  height: calc(var(--nav-height) + var(--nav-safe-bottom));
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px var(--nav-safe-bottom);
  box-sizing: border-box;
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--tr-fast);
  position: relative;
  flex: 1;
  text-align: center;
  min-width: 0;
}

.nav-item:hover { background: var(--bg-card-hover); }

.nav-item.active .nav-icon svg { stroke: var(--primary); filter: drop-shadow(0 0 8px rgba(107,46,229,0.55)); }
.nav-item.active .nav-label { color: var(--primary); font-weight: 800; }

.nav-icon {
  width: 22px; height: 22px;
  position: relative;
}

.nav-icon svg { width: 100%; height: 100%; stroke: var(--text-3); transition: var(--tr-fast); }

.nav-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  transition: var(--tr-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.nav-badge {
  position: absolute;
  top: -2px;
  right: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Nav Plus Button — Tango Gradient */
.nav-plus-btn {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #6B2EE5, #E9407A);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(107, 46, 229, 0.35);
  transition: all var(--tr-med);
  flex-shrink: 0;
  border: 1px solid rgba(107, 46, 229, 0.3);
}

.nav-plus-btn:active { transform: scale(0.9) rotate(5deg); }
.nav-plus-btn svg { width: 24px; height: 24px; stroke: #fff; }

/* =============================================
   Cards & Glass
   ============================================= */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--tr-med);
  box-shadow: var(--shadow-sm);
}

.card:hover { 
  background: var(--bg-card-hover); 
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* =============================================
   Buttons
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all var(--tr-fast);
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, #6B2EE5, #E9407A);
  color: #fff;
  box-shadow: var(--shadow-primary);
  font-weight: 700;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}

.btn-secondary {
  background: linear-gradient(135deg, #E9407A, #C02E5A);
  color: #fff;
  box-shadow: 0 4px 15px rgba(233, 64, 122, 0.35);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #2bb558);
  color: #fff;
}

.btn-glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-glass:hover { background: var(--glass-strong); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #cc0000);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-2);
}

.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--r-sm);
}

.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--r-full); }
.btn-full { width: 100%; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: rgba(107,46,229,0.12); }

/* =============================================
   Inputs
   ============================================= */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  padding: 13px 45px 13px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--tr-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  background: rgba(107, 46, 229, 0.06);
  box-shadow: 0 0 0 3px rgba(107, 46, 229, 0.12);
}

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

.input-icon {
  position: absolute;
  right: 14px;
  width: 20px; height: 20px;
  color: var(--text-3);
  pointer-events: none;
}

.input-icon-left { right: auto; left: 14px; }

textarea.form-input {
  resize: vertical;
  min-height: 80px;
  padding-top: 12px;
}

select.form-input {
  appearance: none;
  cursor: pointer;
}

/* =============================================
   Page Headers
   ============================================= */
.page-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(107, 46, 229, 0.14);
}

.page-title {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.back-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--tr-fast);
}

.back-btn:hover { background: var(--glass-strong); transform: scale(1.05); }
.back-btn svg { width: 22px; height: 22px; stroke: var(--text-1); }

/* =============================================
   Avatars
   ============================================= */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  position: relative;
}

.avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-wrap .avatar,
.avatar-wrap > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-wrap.with-frame .avatar,
.avatar-wrap.with-frame > img {
  width: 72%; /* Shrink avatar proportionally to fit perfectly inside frame */
  height: 72%;
  position: absolute;
}

.avatar-frame {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.24));
}

.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 80px; height: 80px; }
.avatar-xxl { width: 100px; height: 100px; }

/* Verified Badge */
.verified-badge { width: 15px; height: 15px; vertical-align: middle; margin-right: 4px; }

/* =============================================
   Top Gradient Bar — Tango Brand
   ============================================= */
.gradient-bar {
  height: 3px;
  background: linear-gradient(90deg, #6B2EE5, #E9407A, #6B2EE5);
}

/* =============================================
   Modals & Sheets
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--tr-med);
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.bottom-sheet {
  background: var(--bg-2);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  border: 1px solid var(--glass-border);
  width: 100%;
  max-width: 480px;
  padding: 20px;
  transform: translateY(100%);
  transition: transform var(--tr-med);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .bottom-sheet { transform: translateY(0); }

.sheet-handle {
  width: 40px; height: 4px;
  background: var(--glass-border);
  border-radius: 4px;
  margin: 0 auto 20px;
}

.modal-center {
  background: var(--bg-2);
  border-radius: var(--r-xl);
  border: 1px solid var(--glass-border);
  padding: 24px;
  width: 90%;
  max-width: 360px;
  transform: scale(0.9) translateY(-20px);
  transition: transform var(--tr-med);
}

.modal-overlay.active .modal-center { transform: scale(1) translateY(0); }

/* =============================================
   Rooms Grid
   ============================================= */
.rooms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.room-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--tr-med);
  aspect-ratio: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.room-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(107, 46, 229, 0.20);
}

.room-card-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  opacity: 0.2;
  filter: blur(2px);
  transition: all var(--tr-med);
}

.room-card:hover .room-card-bg { opacity: 0.3; transform: scale(1.1); }

.room-card-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px;
  width: 100%;
}

.room-icon {
  width: 64px; height: 64px;
  border-radius: 20px;
  object-fit: cover;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.room-icon svg { width: 34px; height: 34px; color: var(--primary); }

.room-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 6px;
  line-height: 1.3;
}

.room-count {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.room-count svg { width: 12px; height: 12px; }

/* =============================================
   Named Effects
   ============================================= */
.name-fire { 
  background: linear-gradient(135deg, #FF4500, #FF8C00, #FFD700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fire-flicker 1s infinite alternate;
}

.name-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.name-gold-glow {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3);
  animation: gold-pulse 2s infinite;
}

.name-rainbow {
  background: linear-gradient(135deg, #ff0000, #ff6600, #ffff00, #00ff00, #0000ff, #8b00ff);
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow-shift 3s linear infinite;
}

.name-sparkle {
  color: var(--accent-blue);
  text-shadow: 0 0 8px var(--accent-blue);
  animation: sparkle 1.5s infinite;
}

@keyframes fire-flicker {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.3) saturate(1.2); }
}

@keyframes gold-pulse {
  0%, 100% { text-shadow: 0 0 10px rgba(255,215,0,0.6); }
  50% { text-shadow: 0 0 20px rgba(255,215,0,0.9), 0 0 40px rgba(255,215,0,0.4); }
}

@keyframes rainbow-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes sparkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; filter: brightness(1.5); }
}

/* 3D Moving Fire Effect */
.name-3d-fire {
  color: #ffaa00;
  font-weight: 900;
  text-shadow: 
    0 0 4px #fff, 
    0 -2px 4px #ff0, 
    1px -5px 6px #f60, 
    -2px -10px 10px #f30, 
    0 -15px 20px #f00;
  animation: fire-3d-move 0.8s infinite alternate-reverse, fire-glow 2s infinite ease-in-out;
  position: relative;
  display: inline-block;
  transform-style: preserve-3d;
}

.name-3d-fire::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  color: rgba(255, 69, 0, 0.4);
  filter: blur(8px);
  z-index: -1;
  animation: fire-smoke 2s infinite;
}

@keyframes fire-3d-move {
  0% { text-shadow: 0 0 4px #fff, 0 -2px 4px #ff0, 1px -5px 6px #f60, -2px -10px 10px #f30, 0 -15px 20px #f00; transform: skewX(-1deg) scale(1); }
  25% { text-shadow: -1px -1px 3px #fff, 1px -3px 5px #ff0, -1px -6px 8px #f60, 2px -12px 12px #f30, -1px -18px 25px #f00; }
  50% { text-shadow: 1px 0 5px #fff, -1px -4px 7px #ff0, 2px -7px 10px #f60, -2px -15px 15px #f30, 1px -22px 30px #f00; transform: skewX(2deg) scale(1.02); }
  75% { text-shadow: -1px 1px 4px #fff, 0 -3px 6px #ff0, -2px -8px 9px #f60, 1px -13px 14px #f30, 0 -20px 22px #f00; }
  100% { text-shadow: 0 0 6px #fff, 1px -2px 5px #ff0, -1px -4px 7px #f60, 2px -9px 11px #f30, -1px -25px 35px #f00; transform: skewX(-2deg) scale(1); }
}

@keyframes fire-glow {
  0%, 100% { filter: brightness(1) contrast(1.2); }
  50% { filter: brightness(1.5) contrast(1.5) drop-shadow(0 0 10px #ff4500); }
}

@keyframes fire-smoke {
  0% { transform: translateY(0) scale(1); opacity: 0.4; }
  100% { transform: translateY(-20px) scale(1.5); opacity: 0; }
}

/* Neon Cyber Effect */
.name-neon-cyber {
  color: #00f2ff;
  font-weight: 800;
  text-shadow: 
    0 0 5px #00f2ff, 
    0 0 10px #00f2ff, 
    0 0 20px #ff00ff,
    0 0 40px #ff00ff;
  animation: cyber-glow 1.5s infinite alternate, cyber-flicker 3s infinite step-end;
  position: relative;
  letter-spacing: 1px;
}

@keyframes cyber-glow {
  0% { text-shadow: 0 0 5px #00f2ff, 0 0 10px #00f2ff, 0 0 20px #ff00ff; filter: hue-rotate(0deg); }
  100% { text-shadow: 0 0 10px #00f2ff, 0 0 20px #00f2ff, 0 0 40px #ff00ff; filter: hue-rotate(15deg); }
}

@keyframes cyber-flicker {
  0%, 100% { opacity: 1; transform: skew(0deg); }
  92% { opacity: 1; transform: skew(0deg); }
  93% { opacity: 0.8; transform: skew(5deg); }
  94% { opacity: 1; transform: skew(0deg); }
  95% { opacity: 0.5; transform: skew(-5deg); }
  96% { opacity: 1; transform: skew(0deg); }
}

/* Master Toggle Classes */
.effects-disabled .name-fire,
.effects-disabled .name-3d-fire,
.effects-disabled .name-neon-cyber,
.effects-disabled .name-gradient,
.effects-disabled .name-gold-glow,
.effects-disabled .name-rainbow,
.effects-disabled .name-sparkle {
    animation: none !important;
    text-shadow: none !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: var(--text-1) !important;
    filter: none !important;
}

.effects-disabled .name-3d-fire::after { display: none; }
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  max-width: 400px;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s ease;
  backdrop-filter: blur(12px);
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast-msg { font-size: 13px; font-weight: 600; color: var(--text-1); }

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

/* =============================================
   Loading Spinner
   ============================================= */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,8,16,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}

/* =============================================
   Chat Bubbles
   ============================================= */
.messages-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-item {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 85%;
}

.message-item.own {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  border-bottom-right-radius: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  line-height: 1.5;
  position: relative;
  max-width: 100%;
  word-break: break-word;
}

.message-item.own .message-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 10px;
  color: var(--text-4);
  margin-top: 3px;
  padding: 0 4px;
}

/* =============================================
   Reels
   ============================================= */
.reel-item {
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
}

.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 40%, transparent 70%, rgba(0,0,0,0.3) 100%);
}

.reel-actions {
  position: absolute;
  bottom: 100px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.reel-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.reel-action-icon {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all var(--tr-fast);
}

.reel-action-icon:active { transform: scale(0.9); }
.reel-action-icon svg { width: 22px; height: 22px; stroke: #fff; }
.reel-action-label { font-size: 11px; color: #fff; font-weight: 600; }

.reel-info {
  position: absolute;
  bottom: 100px;
  right: 12px;
  left: 80px;
}

.reel-username {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reel-description {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
}

/* =============================================
   Profile
   ============================================= */
.profile-hero {
  padding: 24px 16px 0;
  text-align: center;
  position: relative;
}

.profile-bg {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 150px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0.15;
  border-radius: 0 0 40px 40px;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 16px;
}

.stat-item { text-align: center; cursor: pointer; }
.stat-number { font-size: 20px; font-weight: 800; color: var(--text-1); }
.stat-label { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.profile-display-name {
  font-size: 20px;
  font-weight: 800;
  margin-top: 12px;
}

.profile-username {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

/* =============================================
   Explore
   ============================================= */
.explore-search {
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background: rgba(8,8,16,0.9);
  backdrop-filter: blur(20px);
  z-index: 50;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  padding: 10px 16px;
  transition: all var(--tr-fast);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,92,255,0.15);
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: 14px;
  font-family: inherit;
}

.search-bar svg { width: 18px; height: 18px; stroke: var(--text-3); }

/* =============================================
   Gift Selector
   ============================================= */
.gifts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 8px 0;
}

.gift-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--tr-fast);
}

.gift-item.selected {
  border-color: var(--primary);
  background: rgba(124,92,255,0.1);
}

.gift-item img { width: 40px; height: 40px; object-fit: contain; }
.gift-name { font-size: 10px; color: var(--text-2); text-align: center; }
.gift-price { font-size: 10px; color: var(--gold); font-weight: 700; display: flex; align-items: center; gap: 2px; }

/* =============================================
   Entrance Animation
   ============================================= */
.entrance-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 5000;
  overflow: hidden;
}

.entrance-effect {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: entrance-slide 3s ease forwards;
}

@keyframes entrance-slide {
  0% { transform: translateX(-50%) translateY(100px); opacity: 0; }
  15% { transform: translateX(-50%) translateY(0); opacity: 1; }
  75% { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-50px); opacity: 0; }
}

.entrance-text {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(124,92,255,0.5);
}

.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* =============================================
   Delete Message Modal
   ============================================= */
.delete-options { display: flex; flex-direction: column; gap: 10px; }
.delete-option {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all var(--tr-fast);
  text-align: center;
  font-weight: 600;
}
.delete-option:hover { background: var(--glass-strong); }
.delete-option.danger { color: var(--danger); border-color: rgba(255,71,87,0.3); }

/* =============================================
   Admin Panel
   ============================================= */
.admin-sidebar {
  position: fixed;
  top: 0; right: -300px;
  width: 280px;
  height: 100vh;
  background: var(--bg-2);
  border-left: 1px solid var(--glass-border);
  z-index: 2000;
  transition: right var(--tr-med);
  overflow-y: auto;
  padding: 20px 0;
}

.admin-sidebar.open { right: 0; }

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-main {
  flex: 1;
  padding: 20px;
  max-width: 100%;
  overflow-x: hidden;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 26px; height: 26px; stroke: #fff; }

/* =============================================
   Utility Classes
   ============================================= */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-md { font-size: 14px; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-muted { color: var(--text-3); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.rounded-full { border-radius: 50%; }
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============================================
   Media Queries
   ============================================= */
/* Small mobile tweaks */
@media (max-width: 480px) {
  .app-wrapper { max-width: 100%; }
  .bottom-nav { max-width: 100%; left: 0; transform: none; }
  .modal-overlay .modal-center { width: 95%; }
  .rooms-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }

/* Selection */
::selection { background: rgba(124,92,255,0.3); color: var(--text-1); }

/* Divider */
.divider { height: 1px; background: var(--glass-border); margin: 16px 0; }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}

.tag.primary { background: rgba(124,92,255,0.15); border-color: rgba(124,92,255,0.3); color: var(--primary); }
.tag.gold { background: rgba(255,215,0,0.1); border-color: rgba(255,215,0,0.3); color: var(--gold); }

/* Section Title */
.section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-1);
  padding: 8px 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title a { font-size: 12px; color: var(--primary); font-weight: 600; }

/* Centered Modal */
.modal-overlay.active .modal-center, .modal-overlay .modal-center { display: block; }
.modal-center {
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 28px 24px;
  width: 90%;
  max-width: 340px;
  margin: auto;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  animation: slideUp 0.25s ease;
}
.modal-overlay.active { display: flex; align-items: center; justify-content: center; }

/* Danger button — canonical definition, no duplicate */

/* name effects */
.name-fire { background: linear-gradient(90deg,#FF6B35,#FFB800,#FF4500); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; animation: fireShimmer 1.5s infinite; }
.name-rainbow { background: linear-gradient(90deg,#E9407A,#6B2EE5,#43E97B,#FFB800); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; animation: fireShimmer 2s infinite; }
.name-gold-glow { color: var(--gold); text-shadow: 0 0 8px rgba(255,184,0,0.6), 0 0 20px rgba(255,184,0,0.3); animation: goldPulse 2s ease-in-out infinite; }
.name-gradient { background: linear-gradient(135deg,var(--primary),var(--secondary)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.name-sparkle { animation: sparkle 1s ease-in-out infinite alternate; }

@keyframes fireShimmer { 0%{background-position:0%} 100%{background-position:200%} }
@keyframes goldPulse { 0%,100%{text-shadow:0 0 8px rgba(255,184,0,0.6)} 50%{text-shadow:0 0 20px rgba(255,184,0,0.9),0 0 40px rgba(255,184,0,0.4)} }
@keyframes sparkle { from{filter:brightness(1)} to{filter:brightness(1.5) drop-shadow(0 0 6px var(--primary))} }

/* =============================================
   Voice Message Waveform
   ============================================= */
.voice-recorder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(107,46,229,0.10);
  border-radius: var(--r-full);
  border: 1px solid var(--primary);
}
.voice-timer { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 36px; }
.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  height: 28px;
}
.waveform-bar {
  width: 3px;
  background: var(--primary);
  border-radius: 4px;
  animation: wave-jump 0.6s ease-in-out infinite alternate;
  min-height: 4px;
}
.waveform-bar:nth-child(1){ animation-delay:0s; }
.waveform-bar:nth-child(2){ animation-delay:0.1s; }
.waveform-bar:nth-child(3){ animation-delay:0.2s; }
.waveform-bar:nth-child(4){ animation-delay:0.05s; }
.waveform-bar:nth-child(5){ animation-delay:0.15s; }
.waveform-bar:nth-child(6){ animation-delay:0.25s; }
.waveform-bar:nth-child(7){ animation-delay:0.08s; }
.waveform-bar:nth-child(8){ animation-delay:0.18s; }
@keyframes wave-jump {
  from { height: 4px; opacity: 0.4; }
  to   { height: 22px; opacity: 1; }
}

/* Voice Message Bubble Player */
.voice-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  min-width: 200px;
}
.voice-play-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
}
.voice-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}
.voice-progress-fill {
  height: 100%;
  background: rgba(255,255,255,0.8);
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s;
}

/* =============================================
   DM Conversation Delete
   ============================================= */
.convo-item {
  position: relative;
  overflow: hidden;
}
.convo-delete-btn {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}
.convo-item.swipe-left .convo-delete-btn { transform: translateX(0); }

/* Level & XP Styling */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  vertical-align: middle;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.xp-container {
  background: var(--glass);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}
.xp-bar-bg { background: rgba(255,255,255,0.1) !important; }



/* PWA Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 80px;
  left: 16px;
  right: 16px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 12px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

/* ==============================================
   Feature #50: Color Themes System
   ============================================= */
[data-theme="purple"]  { --primary:#6B2EE5;--primary-dark:#E9407A;--secondary:#E9407A; }
[data-theme="ocean"]   { --primary:#0EA5E9;--primary-dark:#0369A1;--secondary:#06B6D4;--accent:#10B981; }
[data-theme="fire"]    { --primary:#EF4444;--primary-dark:#DC2626;--secondary:#F97316;--accent:#FCD34D; }
[data-theme="emerald"] { --primary:#10B981;--primary-dark:#047857;--secondary:#34D399;--accent:#06B6D4; }
[data-theme="rose"]    { --primary:#EC4899;--primary-dark:#BE185D;--secondary:#F43F5E;--accent:#FBBF24; }
[data-theme="midnight"]{ --bg-1:#000000;--bg-2:#0A0A0A;--bg-3:#1F1F1F;--primary:#818CF8;--secondary:#C084FC; }

.theme-btn { width:44px;height:44px;border-radius:50%;border:3px solid transparent;cursor:pointer;transition:all 0.2s;flex-shrink:0; }
.theme-btn.active,.theme-btn:hover { border-color:var(--text-1);transform:scale(1.1); }

/* ==============================================
   Feature #46: Level Badges
   ============================================= */
.level-badge { display:inline-flex;align-items:center;gap:3px;padding:2px 8px;border-radius:20px;font-size:10px;font-weight:800; }
.level-bronze  { background:rgba(180,110,60,0.2);color:#cd7f32;border:1px solid rgba(180,110,60,0.4); }
.level-silver  { background:rgba(170,170,170,0.2);color:#c0c0c0;border:1px solid rgba(170,170,170,0.4); }
.level-gold    { background:rgba(255,215,0,0.15);color:var(--gold);border:1px solid rgba(255,215,0,0.4);text-shadow:0 0 8px rgba(255,215,0,0.5); }
.level-diamond { background:rgba(100,220,255,0.15);color:#60E8FF;border:1px solid rgba(100,220,255,0.4);animation:diamond-shimmer 2s infinite; }
.level-legend  { background:linear-gradient(135deg,rgba(255,71,87,0.2),rgba(255,215,0,0.2));color:var(--gold);border:1px solid rgba(255,215,0,0.5);animation:legend-glow 1.5s infinite alternate; }

@keyframes diamond-shimmer { 0%,100%{box-shadow:0 0 4px rgba(100,220,255,0.3)} 50%{box-shadow:0 0 12px rgba(100,220,255,0.6)} }
@keyframes legend-glow { 0%{box-shadow:0 0 8px rgba(255,215,0,0.3)} 100%{box-shadow:0 0 20px rgba(255,71,87,0.5)} }

/* Feature #48: Admin Live Stats */
.stat-live-badge { display:inline-flex;align-items:center;gap:4px;font-size:10px;color:var(--success);font-weight:600; }
.stat-live-dot { width:6px;height:6px;background:var(--success);border-radius:50%;animation:pulse 1.5s infinite; }

img.avatar, .avatar { image-rendering:auto; }

/* ==============================================
   Interface Refinements - Square Room Cards
   ============================================= */
/* Room Card V2 consolidated and modernized */
.room-card-v2 {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: block;
  background: #000;
  border: 1px solid rgba(255,255,255,0.12);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  aspect-ratio: 1;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  isolation: isolate;
}

.room-card-v2:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 20px rgba(124,92,255,0.2);
  border-color: rgba(124,92,255,0.4);
}

.room-card-v2-bg {
  position: absolute; inset: 0;
  object-fit: cover; width: 100%; height: 100%;
  opacity: 0.85;
  transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s;
  z-index: -1;
}

.room-card-v2:hover .room-card-v2-bg { transform: scale(1.15); opacity: 1; }
.room-card-v2-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 35%, transparent 60%);
}
.room-card-v2-flag {
  position: absolute; top: 12px; left: 12px;
  width: 24px; height: 16px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  z-index: 2;
}
.room-card-v2-flag img { width: 100%; height: 100%; object-fit: cover; }

.room-card-v2-members-count {
  position: absolute; bottom: 12px; left: 12px;
  display: flex; align-items: center; gap: 5px;
  color: #fff; font-size: 14px; font-weight: 800;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  z-index: 2;
}
.room-card-v2-members-count svg { width: 18px; height: 18px; fill: #fff; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }

.room-card-v2-info {
  position: absolute; bottom: 12px; right: 12px;
  text-align: right;
  z-index: 2;
  max-width: 65%;
}
.room-card-v2-name {
  color: #fff; font-size: 14px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.room-card-v2-active-users {
  display: flex; align-items: center; justify-content: flex-end;
  margin-bottom: 6px;
}
.room-card-v2-active-users .avatar-stack {
  display: flex; flex-direction: row-reverse;
}
.room-card-v2-active-users .avatar-tiny {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  margin-left: -8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* ==============================================
   Short Message Refinements & Dividers
   ============================================= */
.dm-group-divider {
  padding: 16px 16px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dm-group-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--glass-border), transparent);
}
.dm-group-divider.store { color: var(--gold); }
.dm-group-divider.store::after { background: linear-gradient(to right, rgba(255,215,0,0.3), transparent); }

.dm-item-v2 {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  margin-bottom: 8px;
  transition: all var(--tr-fast);
  text-decoration: none;
}
.dm-item-v2:active { transform: scale(0.98); background: rgba(255,255,255,0.05); }
.dm-item-v2.active { border-color: var(--primary); background: rgba(124,92,255,0.05); }
