/* ============================================================
   GLOBAL CHAT — Professional Dark Theme CSS
   Font: Outfit (Display) + DM Sans (Body)
   Theme: Sleek dark social platform, rich glassmorphism accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  /* Core Palette — Light Mode */
  --primary-bg-start: #f4f6fb;
  --primary-bg-end:   #eef0f8;
  --content-bg:       rgba(0,0,0,0.03);
  --secondary-content-bg: rgba(0,0,0,0.05);
  --card-bg:          rgba(255,255,255,0.85);
  --glass-border:     rgba(0,0,0,0.08);

  /* Brand Colors */
  --accent-purple:    #7c4dff;
  --accent-purple-light: #a97bff;
  --accent-blue:      #2979ff;
  --accent-gold:      #f59e0b;
  --accent-gold-light:#fbbf24;
  --primary-blue:     #4f8ef7;

  /* Text */
  --text-color:       #1e1b2e;
  --text-muted:       rgba(30,27,46,0.55);
  --text-heading:     #0f0c1a;

  /* Status */
  --success-green:    #059669;
  --danger-red:       #e11d48;
  --warning-orange:   #d97706;
  --info-blue:        #0284c7;

  /* UI */
  --border-color:        rgba(0,0,0,0.08);
  --border-color-strong: rgba(0,0,0,0.15);
  --input-bg:            rgba(255,255,255,0.9);
  --input-border:        rgba(124,77,255,0.3);
  --input-focus:         rgba(124,77,255,0.6);
  --shadow-soft:         0 4px 24px rgba(0,0,0,0.1);
  --shadow-card:         0 8px 32px rgba(0,0,0,0.12);
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    28px;
  --radius-pill:  999px;

  /* Nav */
  --nav-height: 68px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', sans-serif;
  background: linear-gradient(160deg, var(--primary-bg-start) 0%, var(--primary-bg-end) 100%);
  background-attachment: fixed;
  color: var(--text-color);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 12px);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-purple-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-gold); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-heading);
  line-height: 1.25;
}

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
#splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #f4f6fb 0%, #eef0f8 50%, #e8ecf5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity .5s ease, visibility .5s ease;
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  animation: splashPulse 2s ease-in-out infinite alternate;
}

.splash-content h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 900;
  background: linear-gradient(135deg, #7c4dff, #2979ff, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.splash-content h2 {
  color: rgba(30,27,46,0.55);
  font-size: 1.1rem;
  font-weight: 400;
  font-family: 'DM Sans', sans-serif;
}

.splash-content ul { list-style: none; }

@keyframes splashPulse {
  from { transform: scale(1); opacity: 0.85; }
  to   { transform: scale(1.03); opacity: 1; }
}

/* ============================================================
   LAYOUT: CONTAINER & CONTENT
   ============================================================ */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 14px;
  position: relative;
  z-index: 1;
}

.content {
  padding-top: 10px;
}

.fade-in {
  animation: fadeInUp .45s cubic-bezier(.22,1,.36,1) both;
}

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

.hidden { display: none !important; }

/* ============================================================
   MAIN HEADER
   ============================================================ */
#main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 246, 251, 0.92);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 16px;
}

.coins-display-wrapper {
  max-width: 680px;
  margin: 0 auto;
}

.coins-display {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.coins-display span { color: var(--text-color); }
#coinsDisplay { color: var(--accent-gold); }
#pointsDisplay { color: var(--accent-purple-light); }
#userDisplay { color: var(--text-heading); font-weight: 600; }

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(244, 246, 251, 0.96);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  padding: 0 8px;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.5);
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color .2s, background .2s, transform .15s;
  gap: 3px;
  min-width: 56px;
  position: relative;
}

.bottom-nav-btn:hover {
  color: var(--text-color);
  background: rgba(255,255,255,0.06);
}

.bottom-nav-btn.active {
  color: var(--accent-purple-light);
  background: rgba(124,77,255,0.12);
}

.bottom-nav-btn.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  background: var(--accent-purple-light);
  border-radius: 0 0 4px 4px;
}

/* ============================================================
   TAB CONTENT
   ============================================================ */
.tab-content { animation: fadeInUp .35s cubic-bezier(.22,1,.36,1) both; }

/* ============================================================
   TABS / SUB-TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.tab {
  flex: 1;
  min-width: max-content;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all .22s ease;
  white-space: nowrap;
}

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

.tab.active {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(124,77,255,0.4);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all .22s ease;
  box-shadow: 0 4px 16px rgba(124,77,255,0.35);
  letter-spacing: 0.01em;
  margin-bottom: 10px;
  text-align: center;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,77,255,0.5);
  filter: brightness(1.08);
}

.btn:active:not(:disabled) { transform: translateY(0); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-success {
  background: linear-gradient(135deg, #00c896 0%, #00897b 100%);
  box-shadow: 0 4px 16px rgba(0,200,150,0.3);
}
.btn-success:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(0,200,150,0.45); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger-red) 0%, #c62828 100%);
  box-shadow: 0 4px 16px rgba(255,77,106,0.3);
}
.btn-danger:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(255,77,106,0.45); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1565c0 100%);
  box-shadow: 0 4px 16px rgba(41,121,255,0.35);
}

.btn-google {
  background: #fff;
  color: #333;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  gap: 10px;
}
.btn-google:hover:not(:disabled) {
  background: #f5f5f5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.btn-google svg { flex-shrink: 0; }

.btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  background: rgba(255,255,255,0.08);
  color: var(--text-color);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-small:hover { background: rgba(255,255,255,0.14); border-color: var(--border-color-strong); }

.btn-message { background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue)) !important; color: #fff !important; border-color: transparent !important; }
.btn-gift    { background: linear-gradient(135deg, var(--accent-gold), #e65100) !important; color: #fff !important; border-color: transparent !important; }

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

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-color);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-purple-light);
  box-shadow: 0 0 0 3px rgba(124,77,255,0.2);
  background: rgba(255,255,255,0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(232,224,255,0.35);
}

.form-group select option {
  background: #ffffff;
  color: var(--text-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Standalone inputs (not inside .form-group) */
input[type="email"]:not(.form-group input),
input[type="password"]:not(.form-group input),
input[type="text"]:not(.form-group input),
input[type="tel"]:not(.form-group input),
input[type="number"]:not(.form-group input) {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-color);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  width: 100%;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input[readonly], select[readonly] {
  opacity: 0.65;
  cursor: default;
}

/* ============================================================
   SECTION / STAT CARDS
   ============================================================ */
.section-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  backdrop-filter: blur(12px);
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px 16px;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   USER CARDS
   ============================================================ */
.user-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.user-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(10px);
  transition: all .22s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.user-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,77,255,0.05), transparent);
  opacity: 0;
  transition: opacity .2s;
}

.user-card:hover { border-color: rgba(124,77,255,0.3); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.user-card:hover::before { opacity: 1; }

.user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--border-color-strong);
  position: relative;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-frame {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-gold), var(--accent-purple-light), var(--accent-blue), var(--accent-gold));
  z-index: -1;
}

.user-info { flex: 1; min-width: 0; }
.user-info h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info h4 { font-size: 0.88rem; font-weight: 600; color: var(--text-heading); }
.user-info p  { font-size: 0.8rem; color: var(--text-muted); }

.user-status-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.user-status-text .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-status-text.online  { color: var(--success-green); }
.user-status-text.online  .dot { background: var(--success-green); box-shadow: 0 0 6px var(--success-green); }
.user-status-text.offline .dot { background: var(--text-muted); }

.user-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* ============================================================
   LEVEL BADGES
   ============================================================ */
.wealth-level-badge,
.charm-level-badge,
.vip-badge {
  display: inline-block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-right: 4px;
  letter-spacing: 0.03em;
}

.wealth-level-badge { background: rgba(255,193,7,0.18); color: var(--accent-gold); border: 1px solid rgba(255,193,7,0.3); }
.charm-level-badge  { background: rgba(124,77,255,0.18); color: var(--accent-purple-light); border: 1px solid rgba(124,77,255,0.3); }
.vip-badge          { background: linear-gradient(135deg, var(--accent-gold), #ff8f00); color: #000; border: none; }

/* ============================================================
   CHAT
   ============================================================ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-height) - 140px);
  min-height: 300px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,77,255,0.3) transparent;
}

.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: rgba(124,77,255,0.3); border-radius: 4px; }

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(240,242,248,0.9);
  border-top: 1px solid var(--border-color);
}

.chat-input input[type="text"] {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  color: var(--text-color);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 10px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: auto;
  margin-bottom: 0;
}

.chat-input input:focus { border-color: var(--accent-purple-light); box-shadow: 0 0 0 3px rgba(124,77,255,0.2); }

.send-btn, .gift-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}

.send-btn {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  box-shadow: 0 4px 12px rgba(124,77,255,0.4);
}
.send-btn:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(124,77,255,0.55); }

.gift-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-color);
}
.gift-btn:hover { background: rgba(255,255,255,0.14); }

/* ============================================================
   MESSAGES
   ============================================================ */
.message-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.message-wrapper.own   { flex-direction: row-reverse; }
.message-wrapper.system { justify-content: center; }

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.message-avatar img { width: 100%; height: 100%; object-fit: cover; }

.message {
  max-width: 72%;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.message.own   { background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue)); color: #fff; border-bottom-right-radius: 4px; }
.message.other { background: #ffffff; border: 1px solid var(--border-color); color: var(--text-color); border-bottom-left-radius: 4px; }
.message.system { background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: var(--text-muted); text-align: center; font-size: 0.82rem; border-radius: var(--radius-md); padding: 6px 14px; max-width: 90%; }

.message-header {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.85;
  cursor: pointer;
}

.message-text img {
  border-radius: var(--radius-md);
  max-width: 200px;
  cursor: pointer;
  margin-top: 6px;
}

.message-text audio { margin-top: 6px; width: 180px; }

/* ============================================================
   NOTIFICATION AREA
   ============================================================ */
#notification-area {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 320px;
}

.notification {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-color);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateX(30px);
  transition: all .3s cubic-bezier(.22,1,.36,1);
  pointer-events: auto;
  border-left: 3px solid var(--info-blue);
}

.notification.show { opacity: 1; transform: translateX(0); }
.notification.success { border-left-color: var(--success-green); }
.notification.error   { border-left-color: var(--danger-red); }
.notification.info    { border-left-color: var(--info-blue); }

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: none;
}

.modal.show {
  display: flex;
  animation: modalIn .3s cubic-bezier(.22,1,.36,1);
}

@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-content {
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  animation: modalSlide .3s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
}

@keyframes modalSlide {
  from { transform: translateY(24px) scale(0.97); }
  to   { transform: translateY(0) scale(1); }
}

.modal-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-body {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,77,255,0.3) transparent;
}

.close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .2s;
  line-height: 1;
  background: none;
  border: none;
}
.close:hover { color: var(--text-heading); }

/* ============================================================
   GIFTS GRID
   ============================================================ */
.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.gift-item {
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  font-size: 0.78rem;
  color: var(--text-muted);
  position: relative;
}

.gift-item:hover { border-color: var(--accent-purple-light); background: rgba(124,77,255,0.1); transform: translateY(-2px); }
.gift-item.selected { border-color: var(--accent-purple-light); background: rgba(124,77,255,0.18); box-shadow: 0 0 12px rgba(124,77,255,0.35); }

.gift-icon { font-size: 1.8rem; margin-bottom: 5px; }
.gift-price { color: var(--accent-gold); font-weight: 600; font-size: 0.75rem; margin-top: 4px; }

/* ============================================================
   POSTS / MOMENTS
   ============================================================ */
.post-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  backdrop-filter: blur(10px);
  margin-bottom: 14px;
  transition: box-shadow .2s;
}

.post-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.4); }

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 10px;
}

.post-header-info h4 { font-size: 0.92rem; font-weight: 600; }
.post-header-info p  { font-size: 0.78rem; color: var(--text-muted); }

.post-body { padding: 0 16px 12px; }
.post-text { font-size: 0.92rem; line-height: 1.6; margin-bottom: 10px; }

.post-image {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: opacity .2s;
}
.post-image:hover { opacity: 0.9; }

.post-video {
  width: 100%;
  max-height: 340px;
  border-radius: var(--radius-lg);
}

.post-stats {
  padding: 6px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.post-actions {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
}

.action-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.action-btn:hover  { background: rgba(255,255,255,0.06); color: var(--text-color); }
.action-btn.active { color: var(--danger-red); }

.post-comments { padding: 10px 16px 14px; }

.comment {
  font-size: 0.83rem;
  padding: 7px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  border-left: 2px solid rgba(124,77,255,0.3);
}

.comment-input-area {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.comment-input-area input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  color: var(--text-color);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  padding: 9px 14px;
  outline: none;
  transition: border-color .2s;
  width: auto;
  margin-bottom: 0;
}
.comment-input-area input:focus { border-color: var(--accent-purple-light); }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar-container {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
  border-radius: var(--radius-pill);
  transition: width .4s cubic-bezier(.22,1,.36,1);
}

.progress-bar-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
  text-align: center;
}

/* ============================================================
   GAMES
   ============================================================ */
.games-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.game-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: all .22s ease;
  position: relative;
  overflow: hidden;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,77,255,0.08), rgba(41,121,255,0.06));
  opacity: 0;
  transition: opacity .2s;
}

.game-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.5); border-color: rgba(124,77,255,0.3); }
.game-card:hover::before { opacity: 1; }

.game-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-heading);
}

.game-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.play-btn {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(124,77,255,0.35);
  width: 100%;
}
.play-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(124,77,255,0.5); }

/* Locked button style from JS */
.play-btn:disabled {
  background: linear-gradient(135deg, #4a1a2a, var(--danger-red)) !important;
  cursor: not-allowed;
  opacity: 0.75;
  box-shadow: 0 4px 12px rgba(220,53,69,0.3);
}

.game-pass-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
  border: 1px solid;
}

.game-pass-status.active  { background: rgba(0,200,150,0.12); color: var(--success-green); border-color: rgba(0,200,150,0.3); }
.game-pass-status.expired { background: rgba(255,77,106,0.1);  color: var(--danger-red);    border-color: rgba(255,77,106,0.25); }
.game-pass-status.none    { background: rgba(255,255,255,0.05); color: var(--text-muted);   border-color: var(--border-color); }

/* ============================================================
   VOICE ROOMS
   ============================================================ */
.room-card {
  cursor: default;
}

.room-status-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.room-status-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.room-status-badge.open   { background: rgba(0,200,150,0.15); color: var(--success-green); border: 1px solid rgba(0,200,150,0.3); }
.room-status-badge.full   { background: rgba(255,77,106,0.12); color: var(--danger-red);   border: 1px solid rgba(255,77,106,0.25); }
.room-status-badge.locked { background: rgba(255,193,7,0.12);  color: var(--accent-gold);  border: 1px solid rgba(255,193,7,0.25); }

/* ============================================================
   INBOX
   ============================================================ */
.inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 8px;
}

.inbox-item:hover { background: rgba(255,255,255,0.07); border-color: rgba(124,77,255,0.25); }
.inbox-item.unread { border-left: 3px solid var(--accent-purple-light); background: rgba(124,77,255,0.08); }

.inbox-item-content { flex: 1; min-width: 0; }

.inbox-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.inbox-item-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
}

.inbox-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.inbox-item-message {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.inbox-item-last-msg {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-item-unread-badge {
  background: var(--accent-purple-light);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

/* ============================================================
   PROFILE SUB-VIEWS
   ============================================================ */
.profile-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.profile-edit-actions .btn { margin-bottom: 0; }

/* ============================================================
   SOCIAL USER CARDS
   ============================================================ */
.social-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  margin-bottom: 8px;
  transition: all .2s;
}

.social-user-card:hover { background: rgba(255,255,255,0.07); }

.social-user-info { flex: 1; min-width: 0; }
.social-user-info h4 { font-size: 0.9rem; font-weight: 600; color: var(--text-heading); }
.social-user-info p  { font-size: 0.78rem; color: var(--text-muted); }

.social-user-actions { display: flex; flex-direction: column; gap: 6px; }

/* ============================================================
   PROFILE MODAL
   ============================================================ */
.profile-modal-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin: 12px 0;
}

.profile-modal-stats .stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-heading);
  text-align: center;
}

.profile-modal-stats .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.profile-modal-actions .btn {
  width: auto;
  padding: 10px 20px;
  margin-bottom: 0;
  font-size: 0.88rem;
}

/* ============================================================
   DAILY TASKS
   ============================================================ */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  transition: background .2s;
}

.task-item:hover { background: rgba(255,255,255,0.07); }

.task-icon { font-size: 1.5rem; flex-shrink: 0; }

.task-details { flex: 1; min-width: 0; }

.task-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 5px;
}

.task-reward-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.task-progress {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.task-reward {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* ============================================================
   REFERRAL
   ============================================================ */
.referral-explanation {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.referral-explanation h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.referral-explanation ul {
  list-style: none;
  margin-bottom: 16px;
}

.referral-explanation ul li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 0;
  padding-left: 16px;
  position: relative;
}

.referral-explanation ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-purple-light);
}

.reward-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.reward-table th {
  background: rgba(124,77,255,0.15);
  color: var(--accent-purple-light);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.reward-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

.reward-table tr:last-child td { border-bottom: none; }
.reward-table tr:hover td { background: rgba(255,255,255,0.04); }

.referral-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
}

.referral-info { flex: 1; min-width: 0; }
.referral-info .name { font-size: 0.88rem; font-weight: 600; margin-bottom: 5px; }

.referral-status {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.referral-status.unlocked { background: rgba(0,200,150,0.15); color: var(--success-green); }
.referral-status.pending  { background: rgba(255,193,7,0.12);  color: var(--accent-gold); }

/* ============================================================
   ADMIN / TRANSACTION HISTORY ITEMS
   ============================================================ */
.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.admin-list-item p { margin-bottom: 3px; color: var(--text-muted); }
.admin-list-item p strong { color: var(--text-color); }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: transparent !important;
  border-top: 1px solid var(--border-color) !important;
  margin-top: 40px;
  padding: 24px 0 !important;
  text-align: center;
  font-size: 0.82rem !important;
}

footer a {
  color: var(--text-muted) !important;
  transition: color .2s;
  margin: 0 6px;
}

footer a:hover { color: var(--accent-purple-light) !important; }
footer div[style*="color: #6c757d"] { color: var(--text-muted) !important; margin-top: 10px; }

/* ============================================================
   SCROLLBAR (global)
   ============================================================ */
* { scrollbar-width: thin; scrollbar-color: rgba(124,77,255,0.3) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,77,255,0.35); border-radius: 4px; }

/* ============================================================
   UTILITY
   ============================================================ */
.edit-note { font-size: 0.8em; opacity: 0.7; margin-top: 5px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .container { padding: 0 10px; }

  .coins-display { font-size: 0.76rem; gap: 6px; }

  .chat-container {
    height: calc(100vh - var(--nav-height) - 120px);
    border-radius: var(--radius-lg);
  }

  .games-list { grid-template-columns: 1fr 1fr; gap: 10px; }

  .game-card { padding: 14px; }
  .game-card h3 { font-size: 0.95rem; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .modal-content { border-radius: var(--radius-lg); }

  .profile-edit-actions { flex-direction: column; }
  .profile-edit-actions .btn { width: 100%; }

  .user-list { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .bottom-nav-btn { font-size: 0.6rem; padding: 6px 8px; min-width: 48px; }
  .games-list { grid-template-columns: 1fr; }
}