@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
  --bg: #0D0B1F;
  --bg-secondary: #151229;
  --bg-card: rgba(168, 85, 247, 0.06);
  --glass-border: rgba(168, 85, 247, 0.12);
  --primary: #A855F7;
  --primary-light: #C084FC;
  --primary-dark: #7C3AED;
  --primary-glow: rgba(168, 85, 247, 0.4);
  --accent: #06D6A0;
  --accent-glow: rgba(6, 214, 160, 0.3);
  --secondary: #EC4899;
  --secondary-glow: rgba(236, 72, 153, 0.3);
  --text-main: #F8FAFC;
  --text-muted: rgba(248, 250, 252, 0.55);
  --text-hint: rgba(248, 250, 252, 0.25);
  --danger: #F43F5E;
  --danger-glow: rgba(244, 63, 94, 0.4);
  --success: #06D6A0;
  --gold: #FBBF24;
  --gold-glow: rgba(251, 191, 36, 0.3);
  
  --safe-top: env(safe-area-inset-top, 20px);
  --safe-bot: env(safe-area-inset-bottom, 20px);
  --nav-h: 70px;
  
  --gradient-primary: linear-gradient(135deg, #A855F7, #EC4899);
  --gradient-accent: linear-gradient(135deg, #06D6A0, #3B82F6);
  --gradient-gold: linear-gradient(135deg, #FBBF24, #F59E0B);
  --gradient-bg: linear-gradient(180deg, #0D0B1F 0%, #1A1333 50%, #0D0B1F 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100dvh; overflow: hidden; background: var(--bg); color: var(--text-main); font-family: 'Tajawal', sans-serif; direction: rtl; user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }

.hidden { display: none !important; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; width: 100vw; height: 100dvh; }
.glass-card { background: var(--bg-card); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 24px; }

/* ══════════════════════════════════
   AUTH SCREENS
══════════════════════════════════ */
.auth-bg { position: absolute; inset: 0; background: linear-gradient(160deg, #0D0B1F, #1A1040, #0D0B1F); z-index: 0; overflow: hidden; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.35; animation: floatOrb 10s infinite ease-in-out; }
.orb1 { width: 60vw; height: 60vw; background: #A855F7; top: -10%; right: -20%; }
.orb2 { width: 50vw; height: 50vw; background: #EC4899; bottom: 10%; left: -10%; animation-delay: 2.5s; }
.orb3 { width: 40vw; height: 40vw; background: #FBBF24; bottom: -10%; right: 20%; animation-delay: 5s; opacity: 0.2; }
@keyframes floatOrb { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-30px) scale(1.1)} }

#auth-screen { justify-content: center; align-items: center; padding: 20px; z-index: 10; }
.auth-logo { position: relative; z-index: 2; text-align: center; margin-bottom: 30px; }
.logo-ring { width: 90px; height: 90px; margin: 0 auto 15px; border-radius: 50%; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; font-size: 40px; box-shadow: 0 0 40px var(--primary-glow), 0 0 80px var(--secondary-glow); animation: pulseLogo 3s infinite; }
@keyframes pulseLogo { 0%,100%{box-shadow: 0 0 40px var(--primary-glow)} 50%{box-shadow: 0 0 60px var(--secondary-glow)} }
.auth-logo h1 { font-size: 32px; font-weight: 900; letter-spacing: 1px; }
.auth-logo p { color: var(--text-muted); font-size: 14px; margin-top: 5px; }

.auth-tabs { position: relative; z-index: 2; display: flex; background: rgba(0,0,0,0.3); border-radius: 20px; padding: 5px; margin-bottom: 20px; width: 100%; max-width: 380px; }
.auth-tab { flex: 1; padding: 12px 0; border: none; background: transparent; color: var(--text-muted); font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; z-index: 2; transition: 0.3s; }
.auth-tab.active { color: #fff; }
.auth-tab-indicator { position: absolute; top: 5px; right: 5px; width: calc(50% - 5px); height: calc(100% - 10px); background: var(--gradient-primary); border-radius: 15px; z-index: 1; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

.auth-card { position: relative; z-index: 2; width: 100%; max-width: 380px; padding: 30px 24px; animation: slideUp 0.4s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) } to { opacity: 1; transform: translateY(0) } }

/* Inputs */
.auth-input, .phone-input { width: 100%; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; color: #fff; font-family: inherit; font-size: 15px; outline: none; transition: 0.3s; }
.auth-input { padding: 16px; margin-bottom: 16px; }
.auth-input:focus, .phone-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(168,85,247,0.2); }

/* Phone Row */
.phone-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.country-select-wrap { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 0 12px; height: 53px; cursor: pointer; flex-shrink: 0; }
.drop-arrow { font-size: 12px; color: var(--text-muted); }
.phone-input { padding: 16px; height: 53px; flex: 1; direction: ltr; text-align: left; }
.phone-err { color: var(--danger); font-size: 12px; margin-top: -10px; margin-bottom: 16px; padding-right: 5px; }

/* Password Eye */
.pass-wrap { position: relative; margin-bottom: 16px; }
.pass-wrap .auth-input { margin-bottom: 0; }
.eye-btn { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 18px; color: var(--text-muted); cursor: pointer; }

.btn-auth { width: 100%; padding: 16px; border: none; border-radius: 14px; background: var(--gradient-primary); color: #fff; font-size: 16px; font-weight: 800; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: 0.3s; box-shadow: 0 5px 25px var(--primary-glow), 0 2px 10px var(--secondary-glow); }
.btn-auth:active { transform: scale(0.97); }
.btn-ghost-sm { padding: 16px; border: 1px solid rgba(255,255,255,0.2); border-radius: 14px; background: transparent; color: #fff; font-family: inherit; cursor: pointer; }

/* Register Steps */
.step-indicator { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 15px; }
.step-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.2); }
.step-dot.active { background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.step-line { width: 40px; height: 2px; background: rgba(255,255,255,0.2); }
.step-line.active { background: var(--primary); }
.step-label { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; font-weight: 700; }

.avatar-upload-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 20px; cursor: pointer; }
.avatar-preview-circle { width: 80px; height: 80px; border-radius: 50%; background: rgba(0,0,0,0.3); border: 2px dashed rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center; font-size: 24px; background-size: cover; background-position: center; }
.avatar-preview-circle.sm { width: 60px; height: 60px; }
.upload-hint { font-size: 12px; color: var(--text-muted); }

.gender-row { display: flex; gap: 10px; }
.gender-btn { flex: 1; padding: 14px; border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; background: rgba(0,0,0,0.2); color: var(--text-muted); font-family: inherit; font-size: 15px; cursor: pointer; transition: 0.3s; }
.gender-btn.active { background: rgba(168, 85, 247, 0.2); border-color: var(--primary); color: #fff; }

/* ══════════════════════════════════
   COUNTRY PICKER MODAL
══════════════════════════════════ */
.country-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin-top: 15px; padding-right: 5px; }
.country-item { display: flex; align-items: center; gap: 10px; padding: 14px; background: rgba(0,0,0,0.2); border-radius: 12px; cursor: pointer; }
.country-item:active { background: rgba(255,255,255,0.1); }
.country-item .cc { margin-right: auto; color: var(--text-muted); font-size: 13px; direction: ltr; }

/* ══════════════════════════════════
   MAIN APP & TABS
══════════════════════════════════ */
.tab-content { display: none; flex-direction: column; height: calc(100dvh - var(--nav-h)); padding-top: var(--safe-top); }
.tab-content.active { display: flex; }
.tab-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; flex-shrink: 0; }
.tab-header h1 { font-size: 26px; font-weight: 900; }
.greeting-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 2px; }
.avatar-header-btn { background: none; border: none; cursor: pointer; padding: 0; }
.header-avatar-circle { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; border: 2px solid var(--glass-border); color: #fff; background-position: center; }

.tab-scroll { flex: 1; overflow-y: auto; padding: 10px 20px 20px; -webkit-overflow-scrolling: touch; }

/* ══════════════════════════════════════════════════════════
   🏠 PREMIUM HOME PAGE — 2026 Redesign
══════════════════════════════════════════════════════════ */

/* ── Home Header ── */
.home-header {
  padding: calc(var(--safe-top) + 8px) 20px 0;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(168,85,247,0.08) 0%, transparent 100%);
}
.home-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.home-greeting h1 { font-size: 24px; font-weight: 900; }
.home-search-wrap {
  position: relative;
  margin-bottom: 6px;
}
.home-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-hint);
  pointer-events: none;
}
.home-search-input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: all 0.3s ease;
}
.home-search-input::placeholder { color: var(--text-hint); }
.home-search-input:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}

.home-scroll { padding: 12px 16px 20px !important; }

/* ── Stats Strip ── */
.home-stats-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.stat-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  transition: all 0.3s ease;
}
.stat-chip:active { transform: scale(0.96); }
.stat-chip-icon { font-size: 22px !important; }
.stat-chip-val {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
}
.stat-chip-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.glow-chip {
  background: rgba(251,191,36,0.06);
  border-color: rgba(251,191,36,0.15);
  position: relative;
  overflow: hidden;
}
.glow-chip::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(251,191,36,0.08) 0%, transparent 70%);
  animation: glowChipPulse 3s ease-in-out infinite;
}
@keyframes glowChipPulse {
  0%,100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}
.glow-chip .stat-chip-val { color: #FBBF24; }

/* ── Section Header ── */
.rooms-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient-primary);
  box-shadow: 0 0 10px var(--primary-glow);
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%,100% { box-shadow: 0 0 6px var(--primary-glow); transform: scale(1); }
  50% { box-shadow: 0 0 14px var(--primary-glow); transform: scale(1.3); }
}
.section-title {
  font-size: 17px;
  font-weight: 900;
  color: #fff;
}
.btn-create-room-new {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(236,72,153,0.1));
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 24px;
  color: var(--primary-light);
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn-create-room-new::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: btnShine 4s infinite;
}
@keyframes btnShine { 0%{left:-100%} 40%,100%{left:100%} }
.btn-create-room-new:active { transform: scale(0.94); }

/* ══════════════════════════════════════════════════════════
   🎴 ROOM CARDS — Premium Glassmorphic Design
══════════════════════════════════════════════════════════ */
.rooms-grid-new {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Single Room Card */
.room-card-new {
  position: relative;
  display: flex;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  min-height: 110px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.room-card-new:active {
  transform: scale(0.97);
  border-color: rgba(168,85,247,0.2);
}
/* Top shimmer */
.room-card-new::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(168,85,247,0.3) 30%, rgba(236,72,153,0.3) 70%, transparent 100%);
  z-index: 1;
}

/* Card Image Side */
.rc-image-wrap {
  position: relative;
  width: 110px;
  min-height: 110px;
  flex-shrink: 0;
  overflow: hidden;
}
.rc-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rc-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(236,72,153,0.08));
  font-size: 36px;
}
/* Gradient overlay on image */
.rc-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(13,11,31,0.8) 100%);
  pointer-events: none;
}

/* Card Body */
.rc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 14px;
  min-width: 0;
  gap: 6px;
}
.rc-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rc-name {
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  line-height: 1.3;
}
.rc-live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(6,214,160,0.12);
  border: 1px solid rgba(6,214,160,0.25);
  border-radius: 20px;
  flex-shrink: 0;
}
.rc-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #06D6A0;
  box-shadow: 0 0 8px #06D6A0;
  animation: liveDotPulse 1.5s ease-in-out infinite;
}
@keyframes liveDotPulse {
  0%,100% { opacity: 1; box-shadow: 0 0 6px #06D6A0; }
  50% { opacity: 0.5; box-shadow: 0 0 12px #06D6A0; }
}
.rc-live-text {
  font-size: 10px;
  font-weight: 900;
  color: #06D6A0;
  letter-spacing: 1px;
}

.rc-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Bottom Row: Members + Info */
.rc-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

/* Avatar Stack */
.rc-avatars {
  display: flex;
  align-items: center;
}
.rc-av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(13,11,31,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  margin-left: -6px;
  background-size: cover;
  background-position: center;
  position: relative;
  z-index: 1;
}
.rc-av:first-child { margin-left: 0; z-index: 3; }
.rc-av:nth-child(2) { z-index: 2; }
.rc-av-more {
  background: rgba(168,85,247,0.3);
  border-color: rgba(168,85,247,0.4);
  font-size: 9px;
  color: var(--primary-light);
}

.rc-members-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.rc-members-count .material-icons { font-size: 16px !important; }

/* ── Room Card Hover/Focus Glow ── */
.room-card-new::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(135deg, rgba(168,85,247,0.04) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Active Room Highlight (has users) ── */
.room-card-new.rc-active {
  border-color: rgba(168,85,247,0.12);
  background: rgba(168,85,247,0.04);
}
.room-card-new.rc-active::after { opacity: 1; }

/* ── Voice Wave Indicator (mini EQ for live rooms) ── */
.rc-voice-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.rc-voice-wave span {
  width: 2.5px;
  border-radius: 2px;
  background: var(--primary);
}
.rc-voice-wave span:nth-child(1) { height: 5px; animation: rcWave 0.5s ease-in-out infinite alternate; }
.rc-voice-wave span:nth-child(2) { height: 10px; animation: rcWave 0.4s ease-in-out infinite alternate 0.1s; }
.rc-voice-wave span:nth-child(3) { height: 7px; animation: rcWave 0.45s ease-in-out infinite alternate 0.2s; }
@keyframes rcWave {
  0% { height: 3px; opacity: 0.5; }
  100% { height: 14px; opacity: 1; }
}

/* ══════════════════════════════════════════════════════════
   📭 EMPTY STATE — Modern Illustration
══════════════════════════════════════════════════════════ */
.empty-state-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-illustration {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-circle {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
}
.empty-circle.c1 {
  width: 120px; height: 120px;
  border-color: rgba(168,85,247,0.15);
  animation: emptyRing 4s ease-in-out infinite;
}
.empty-circle.c2 {
  width: 90px; height: 90px;
  border-color: rgba(236,72,153,0.12);
  animation: emptyRing 4s ease-in-out 0.5s infinite reverse;
}
.empty-circle.c3 {
  width: 60px; height: 60px;
  border-color: rgba(6,214,160,0.1);
  animation: emptyRing 4s ease-in-out 1s infinite;
}
@keyframes emptyRing {
  0%,100% { transform: scale(1) rotate(0deg); opacity: 0.5; }
  50% { transform: scale(1.1) rotate(180deg); opacity: 1; }
}
.empty-icon {
  font-size: 40px !important;
  color: var(--primary);
  filter: drop-shadow(0 0 15px var(--primary-glow));
  animation: emptyFloat 3s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
@keyframes emptyFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.empty-state-new h3 {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 8px;
}
.empty-state-new p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 260px;
  line-height: 1.5;
}
.btn-create-first {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 24px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 30px var(--primary-glow);
  transition: all 0.3s ease;
}
.btn-create-first:active { transform: scale(0.95); }

/* ── Skeleton Loading ── */
.room-card-skeleton {
  display: flex;
  min-height: 110px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
}
.room-card-skeleton .skel-img {
  width: 110px;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.02) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.5s infinite;
}
.room-card-skeleton .skel-body {
  flex: 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.5s infinite;
}
.skel-line.w60 { width: 60%; }
.skel-line.w80 { width: 80%; }
.skel-line.w40 { width: 40%; }
@keyframes skelShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Room Card Entrance Animation ── */
.room-card-new {
  animation: roomCardIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}
@keyframes roomCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Reels Grid (Profile) */
.reels-grid-small { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 10px; }
.reel-thumb-item { position: relative; aspect-ratio: 9/16; background: #000; overflow: hidden; cursor: pointer; border-radius: 4px; }
.reel-thumb-item video { width: 100%; height: 100%; object-fit: cover; }
.reel-thumb-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,0.8); font-size: 20px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); pointer-events: none; }
.reel-thumb-delete { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.6); border: none; color: #ff416c; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; z-index: 5; border: 1px solid rgba(255,255,255,0.1); }
.reel-thumb-delete:hover { background: var(--danger); color: #fff; }

/* Messages */
.msg-rooms-list { display: flex; flex-direction: column; gap: 12px; padding: 0 10px; }
.msg-room-item { display: flex; align-items: center; gap: 15px; padding: 15px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); border-radius: 20px; cursor: pointer; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.msg-room-item:active { transform: scale(0.95); background: rgba(255,255,255,0.08); }
.msg-room-avatar { position: relative; width: 55px; height: 55px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: #fff; flex-shrink: 0; box-shadow: 0 5px 15px rgba(0,0,0,0.2); background-size: cover; background-position: center; border: 2px solid rgba(255,255,255,0.1); }
.online-indicator { position: absolute; bottom: -2px; right: -2px; width: 14px; height: 14px; background: #00f3ff; border: 3px solid var(--bg); border-radius: 50%; box-shadow: 0 0 8px #00f3ff; }
.msg-room-info { flex: 1; min-width: 0; }
.msg-room-name { font-weight: 800; font-size: 16px; margin-bottom: 5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-room-last { font-size: 13px; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-time-badge { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.unread-badge { background: linear-gradient(135deg, #ff416c, #ff4b2b); color: #fff; font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 12px; box-shadow: 0 4px 10px rgba(255,65,108,0.4); }

/* Profile */
.profile-scroll { padding: 0 !important; }
.profile-header-bg { background: linear-gradient(180deg, rgba(168,85,247,0.12) 0%, transparent 100%); padding: 30px 20px; text-align: center; }
.profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 15px; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 900; border: 4px solid var(--bg-card); box-shadow: 0 10px 20px rgba(0,0,0,0.3); overflow: hidden; margin: 0 auto; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.edit-avatar-btn { position: absolute; bottom: 0; left: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); border: 3px solid var(--bg); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; }
.verified-badge { display: inline-flex; align-items: center; background: rgba(0, 255, 136, 0.1); color: var(--success); padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; margin: 8px 0; border: 1px solid rgba(0, 255, 136, 0.2); }
.level-badge { background: var(--primary-glow); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); display: inline-block; }
.level-progress-wrap { width: 100%; height: 8px; background: rgba(255,255,255,0.05); border-radius: 10px; margin-top: 10px; overflow: hidden; position: relative; border: 1px solid rgba(255,255,255,0.05); }
.level-progress-fill { height: 100%; background: var(--gradient-primary); border-radius: 10px; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 0 10px var(--primary); }
.profile-bio { color: var(--text-muted); font-size: 14px; margin-top: 10px; max-width: 80%; margin-left: auto; margin-right: auto; line-height: 1.5; }
.profile-menu { padding: 0 20px 20px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 15px; padding: 18px; background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: 16px; margin-bottom: 10px; cursor: pointer; color: #fff; font-size: 15px; font-family: inherit; font-weight: 700; }
.menu-item.danger { border-color: rgba(255,65,108,0.2); color: var(--danger); background: rgba(255,65,108,0.05); }
.menu-item.accent { border-color: rgba(0,210,255,0.3); color: var(--accent); background: rgba(0,210,255,0.05); }
.menu-arrow { margin-right: auto; color: var(--text-hint); font-size: 18px; }

/* Bottom Nav */
#bottom-nav { height: calc(var(--nav-h) + var(--safe-bot)); padding-bottom: var(--safe-bot); display: flex; align-items: center; justify-content: space-around; background: rgba(6,7,26,0.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--glass-border); z-index: 50; }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: none; border: none; color: var(--text-hint); font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; flex: 1; height: var(--nav-h); position: relative; transition: 0.3s; }
.nav-item svg { width: 26px; height: 26px; stroke-width: 2.5; transition: 0.3s; }
.nav-item.active { color: var(--accent); }
.nav-item.active::after { content: ''; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* ══════════════════════════════════
   ROOM VIEW (NIGHT THEME)
══════════════════════════════════ */
.room-theme-night { background: linear-gradient(180deg, #0D0B1F 0%, #1A1040 50%, #0D0B1F 100%); z-index: 100; }
.room-bg-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.stars { position: absolute; top: 0; left: 0; right: 0; height: 60%; background-image: radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 4px); background-size: 120px 120px; opacity: 0.4; animation: twinkle 8s infinite linear; }
.mountains-back { position: absolute; bottom: 120px; left: 0; width: 200%; height: 30vh; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%2311142F' d='M0,192L48,181.3C96,171,192,149,288,149.3C384,149,480,171,576,197.3C672,224,768,256,864,250.7C960,245,1056,203,1152,181.3C1248,160,1344,160,1392,160L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") repeat-x; background-size: 50vw 100%; opacity: 0.5; }
.mountains-front { position: absolute; bottom: 80px; left: -10vw; width: 220%; height: 25vh; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%230A0B1A' d='M0,224L60,202.7C120,181,240,139,360,133.3C480,128,600,160,720,176C840,192,960,192,1080,176C1200,160,1320,128,1380,112L1440,96L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") repeat-x; background-size: 50vw 100%; }
.particles { position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,255,255,0.8) 1.5px, transparent 2px); background-size: 20vw 20vw; opacity: 0.15; animation: drift 30s infinite linear; }
@keyframes twinkle { from { background-position: 0 0 } to { background-position: -120px 120px } }
@keyframes drift { from { background-position: 0 0 } to { background-position: -20vw 20vw } }

.premium-header { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-top)) 16px 10px; z-index: 10; background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%); flex-shrink: 0; }
.header-left { display: flex; align-items: center; }
.room-host-badge { display: flex; align-items: center; background: rgba(0,0,0,0.5); border-radius: 24px; padding: 4px 14px 4px 4px; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.15); }
.host-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); margin-left: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; color: #fff; background-position: center; }
.host-info { display: flex; flex-direction: column; }
#room-title { font-size: 13px; font-weight: 800; color: #fff; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-id-label { font-size: 10px; color: var(--text-muted); font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 8px; }
.live-badge { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.5); padding: 6px 12px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); font-size: 12px; font-weight: 800; }
.live-dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; box-shadow: 0 0 10px var(--danger); animation: blink 1s infinite alternate; }
@keyframes blink { from { opacity: 1 } to { opacity: 0.3 } }
.icon-glass { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.4); backdrop-filter: blur(10px); color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.icon-glass:active { transform: scale(0.9); }
.icon-glass.danger { background: rgba(255,65,108,0.2); border-color: rgba(255,65,108,0.4); color: var(--danger); }

/* Mics Horizontal - Royal Arch Design */
.top-mics-container { 
    display: flex; 
    justify-content: space-around;
    width: 100%; 
    padding: 15px 5px 25px; 
    z-index: 10; 
    flex-shrink: 0; 
}

.premium-mic { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    position: relative; 
    cursor: pointer; 
    flex: 1;
}

/* AVATAR DESIGN: Royal Arch Shape (Portrait Window) */
.mic-avatar { 
    width: 60px; 
    height: 75px; 
    border-radius: 30px 30px 12px 12px; 
    background: linear-gradient(135deg, rgba(42, 42, 78, 0.8), rgba(26, 26, 46, 0.8)); 
    border: 2px solid rgba(255, 255, 255, 0.4); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px; 
    font-weight: bold; 
    position: relative; 
    z-index: 2; 
    transition: all 0.3s ease; 
    color: #fff; 
    background-position: center; 
    background-size: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.mic-avatar.empty { 
    border-style: dashed; 
    color: rgba(255,255,255,0.4); 
    background: rgba(255,255,255,0.05); 
}

/* NAME PLATE: Minimal pill floating below */
.mic-name { 
    font-size: 11px; 
    font-weight: 700; 
    color: #fff; 
    background: rgba(0,0,0,0.6);
    padding: 4px 10px;
    border-radius: 12px;
    margin-top: 6px;
    z-index: 3;
    position: relative;
    max-width: 70px;
    text-align: center; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    border: 1px solid rgba(255,255,255,0.1);
}

/* Host Slot Styling */
.premium-mic.host-slot .mic-avatar {
    border-color: #ffd32a;
    box-shadow: 0 4px 15px rgba(255, 211, 42, 0.2);
}

/* ══════════════════════════════════════════════════════════
   ✨ ROYAL ARCH SPEAKING EFFECT ✨
══════════════════════════════════════════════════════════ */
.premium-mic { --audio-level: 0; }

.premium-mic.speaking .mic-avatar {
    border-color: #00f2fe; 
    transform: translateY(-4px) scale(calc(1 + 0.03 * var(--audio-level)));
    transition: transform 0.1s ease-out, border-color 0.2s;
}
.premium-mic.speaking.host-slot .mic-avatar {
    border-color: #ffd32a;
}
.premium-mic.speaking .mic-name {
    border-color: #00f2fe;
}
.premium-mic.speaking.host-slot .mic-name {
    border-color: #ffd32a;
}

/* 2. Expanding Arch Waves */
.speaking-waves {
    position: absolute;
    top: 37.5px; /* Center of 75px avatar */
    left: 50%;
    transform: translate(-50%,-50%);
    width: 60px; 
    height: 75px;
    pointer-events: none;
    z-index: 0;
}

.speaking-waves span {
    position: absolute;
    inset: 0;
    border-radius: 30px 30px 12px 12px; 
    border: 2px solid #00f2fe;
    opacity: 0;
}
.premium-mic.host-slot .speaking-waves span {
    border-color: #ffd32a;
}
.premium-mic.speaking .speaking-waves span {
    animation: archRipple 1.5s cubic-bezier(0.1, 0.7, 0.3, 1) infinite;
}
.premium-mic.speaking .speaking-waves span:nth-child(2) { animation-delay: 0.5s; }
.premium-mic.speaking .speaking-waves span:nth-child(3) { animation-delay: 1.0s; }
@keyframes archRipple {
    0% { transform: scale(1); opacity: 0.8; border-width: 2px; }
    100% { transform: scale(1.5); opacity: 0; border-width: 0px; border-radius: 40px 40px 20px 20px; }
}

/* 3. Embedded Voice Bar */
.mic-voice-bar {
    position: absolute;
    top: 55px; /* Inside the lower portion of the arch */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    align-items: flex-end;
    justify-content: center;
    height: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
    background: rgba(0,0,0,0.5);
    padding: 2px 4px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
}
.premium-mic.speaking .mic-voice-bar { opacity: 1; }

.mic-voice-bar span {
    width: 2.5px;
    border-radius: 2px;
    background: #00f2fe;
}
.premium-mic.host-slot .mic-voice-bar span {
    background: #ffd32a;
}
.mic-voice-bar span:nth-child(1) { height: calc(20% + 80% * var(--audio-level)); transition: height 0.1s ease; }
.mic-voice-bar span:nth-child(2) { height: calc(40% + 60% * var(--audio-level)); transition: height 0.15s ease; }
.mic-voice-bar span:nth-child(3) { height: calc(10% + 90% * var(--audio-level)); transition: height 0.1s ease; }
.mic-voice-bar span:nth-child(4), .mic-voice-bar span:nth-child(5) { display: none; }

.mic-glow { display: none !important; }
.premium-mic .audio-level-ring { display: none; }

/* Chat */
.center-chat-area { flex: 1; min-height: 0; display: flex; flex-direction: column; z-index: 10; position: relative; overflow: hidden; }
.chat-inner-scroll { flex: 1; overflow-y: auto; padding: 10px 16px 20px; display: flex; flex-direction: column; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.live-chat-msgs { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 10px; }
.live-msg { 
    display: flex; gap: 8px; align-items: flex-end; align-self: flex-start; 
    max-width: 90%; color: #fff; animation: msg-up 0.3s ease-out forwards; 
    word-wrap: break-word; line-height: 1.4; padding: 2px 0;
}
.live-msg.me { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar { 
    width: 34px; height: 34px; border-radius: 50%; 
    background-size: cover; background-position: center; 
    flex-shrink: 0; border: 2px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.msg-content-wrap {
    display: flex; flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 10px 14px;
    border-radius: 20px 20px 20px 4px;
    border: 1px solid rgba(255,255,255,0.1);
    border-top-color: rgba(255,255,255,0.3);
    border-left-color: rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.live-msg.me .msg-content-wrap { 
    border-radius: 20px 20px 4px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
    border-color: rgba(102, 126, 234, 0.4);
    border-top-color: rgba(118, 75, 162, 0.5);
}

.live-msg.vip-msg .msg-avatar { border-color: var(--gold); box-shadow: 0 0 10px var(--gold); }
.live-msg.vip-msg .msg-content-wrap {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.1));
    border-color: rgba(255, 215, 0, 0.3);
    border-top-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.15);
}

.msg-user-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.live-msg.me .msg-user-row { flex-direction: row-reverse; }

.lm-user { color: var(--gold); font-weight: 800; font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.live-msg.me .lm-user { color: #fff; }
.live-msg.vip-msg .lm-user { color: var(--gold); text-shadow: 0 0 5px rgba(255,215,0,0.5); }

.msg-text { font-size: 14.5px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.live-msg.sys { align-self: center; max-width: 100%; justify-content: center; }
@keyframes msg-up { from { opacity: 0; transform: translateY(15px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Right Float */
.vertical-float-btns { position: absolute; right: 16px; bottom: calc(90px + var(--safe-bot)); display: flex; flex-direction: column; gap: 15px; z-index: 15; }
.v-btn { width: 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,0.5); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.15); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 15px rgba(0,0,0,0.4); transition: 0.2s; }
.v-btn:active { transform: scale(0.9); }
.gift-btn { background: var(--gradient-primary); border-color: rgba(236,72,153,0.5); animation: pulseGift 2s infinite; }
.gift-icon-svg { font-size: 24px; filter: drop-shadow(0 0 5px rgba(255,255,255,0.8)); }
@keyframes pulseGift { 0%,100%{box-shadow: 0 5px 15px var(--primary-glow)} 50%{box-shadow: 0 5px 25px var(--secondary-glow)} }

/* FAB Mic */
.fab-controls { position: absolute; left: 16px; bottom: calc(85px + var(--safe-bot)); z-index: 50; }
.fab-btn { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,0.15); backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.3); color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 32px rgba(0,0,0,0.5); cursor: pointer; transition: 0.3s; }
.fab-btn.raised { background: rgba(0,210,255,0.3); border-color: var(--accent); box-shadow: 0 0 25px rgba(0,210,255,0.5); }
.fab-btn.mic-on { background: rgba(0,255,136,0.3); border-color: var(--success); color: var(--success); box-shadow: 0 0 25px rgba(0,255,136,0.4); }
.fab-btn.mic-off { background: rgba(255,65,108,0.3); border-color: var(--danger); color: var(--danger); box-shadow: 0 0 25px rgba(255,65,108,0.4); }
.fab-btn:active { transform: scale(0.9); }

/* Bottom Bar */
.premium-bottom-bar { display: flex; align-items: center; width: 100vw; padding: 10px 16px calc(10px + var(--safe-bot)); background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.9) 100%); z-index: 20; flex-shrink: 0; }
.chat-input-glass { flex: 1; display: flex; align-items: center; background: rgba(0,0,0,0.6); backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.15); border-radius: 30px; padding: 6px 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.4); }
.chat-input-glass input { flex: 1; background: transparent; border: none; color: #fff; padding: 8px 12px; font-size: 15px; font-family: inherit; outline: none; }
.chat-input-glass input::placeholder { color: var(--text-hint); }
.emoji-btn { background: none; border: none; font-size: 24px; padding: 6px; cursor: pointer; }
.send-glow-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--gradient-primary); border: none; color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 0 15px var(--primary-glow); flex-shrink: 0; }
.send-glow-btn:active { transform: scale(0.9); }

/* ══════════════════════════════════
   GIFT ANIMATIONS
══════════════════════════════════ */
.gift-layer { position: absolute; inset: 0; pointer-events: none; z-index: 999; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: background 0.3s; }
.gift-layer.active { background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); }

.gift-anim-wrap { position: relative; display: flex; flex-direction: column; align-items: center; animation: giftEpicZoom 4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; transform-style: preserve-3d; perspective: 1000px; }
.gift-anim-media { width: 80vw; max-width: 400px; height: auto; max-height: 60vh; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.8)) drop-shadow(0 0 30px rgba(240,147,251,0.6)); animation: giftHover 3s ease-in-out infinite; }
.gift-anim-from { background: linear-gradient(135deg, rgba(255,215,0,0.9), rgba(255,140,0,0.9)); backdrop-filter: blur(10px); padding: 8px 30px; border-radius: 30px; color: #000; font-size: 18px; font-weight: 900; box-shadow: 0 10px 25px rgba(255,215,0,0.6); text-transform: uppercase; margin-bottom: 20px; text-shadow: 0 1px 2px rgba(255,255,255,0.5); border: 2px solid #fff; }
.gift-anim-name { font-size: 40px; font-weight: 900; color: #fff; text-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold), 0 0 40px var(--gold); margin-top: 20px; letter-spacing: 2px; }

/* Combo Counter */
.gift-combo { position: absolute; top: -30px; right: -30px; font-size: 60px; font-weight: 900; color: #fff; -webkit-text-stroke: 3px var(--danger); text-shadow: 0 0 30px var(--danger), 0 5px 15px rgba(0,0,0,0.5); animation: comboPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes comboPop { 0% { transform: scale(0) rotate(-30deg); opacity: 0; } 100% { transform: scale(1) rotate(15deg); opacity: 1; } }

/* Glowing particles */
.gift-sparkle { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff; animation: sparkleExplode 1.5s ease-out forwards; pointer-events: none; }

/* Enhanced Animations */
@keyframes giftEpicZoom { 
  0% { transform: scale(0) translateZ(-500px) rotateY(-90deg); opacity: 0 } 
  10% { transform: scale(1.1) translateZ(50px) rotateY(10deg); opacity: 1 } 
  15% { transform: scale(1) translateZ(0) rotateY(0); opacity: 1 } 
  85% { transform: scale(1) translateZ(0) rotateY(0); opacity: 1 } 
  100% { transform: scale(1.5) translateZ(500px) rotateY(90deg); opacity: 0 } 
}
@keyframes giftHover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
@keyframes sparkleExplode { 0% { transform: translate(0, 0) scale(0.5); opacity: 1 } 100% { transform: translate(var(--tx), var(--ty)) scale(1.5); opacity: 0 } }

/* Screen Flash */
.screen-flash { position: absolute; inset: 0; background: #fff; pointer-events: none; z-index: 9999; animation: flashFade 0.5s ease-out forwards; mix-blend-mode: overlay; }
@keyframes flashFade { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ══════════════════════════════════
   ENTRANCE ANIMATIONS
══════════════════════════════════ */
.entrance-layer { position: absolute; top: 120px; left: 0; width: 100%; pointer-events: none; z-index: 1000; display: flex; flex-direction: column; gap: 10px; padding: 0 16px; overflow: hidden; }
.entrance-banner {
    display: flex; align-items: center; gap: 12px;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    border-radius: 40px; padding: 6px 16px 6px 6px;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff; font-size: 14px;
    transform: translateX(120%);
    animation: slideInEntrance 4s ease-in-out forwards;
    width: max-content;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.entrance-banner .ent-avatar {
    border-radius: 50%;
    background-color: var(--primary); background-size: cover; background-position: center;
    border: 2px solid rgba(255,255,255,0.2);
}
.entrance-banner .ent-text { display: flex; flex-direction: column; justify-content: center; padding-right: 10px; }
.entrance-banner .ent-name { font-weight: 800; color: var(--accent); font-size: 14px; }
.entrance-banner .ent-desc { font-size: 11px; color: rgba(255,255,255,0.7); }

.entrance-banner.vip {
    background: linear-gradient(90deg, rgba(255,215,0,0.25) 0%, rgba(255,215,0,0.05) 100%);
    border: 1px solid rgba(255,215,0,0.5);
    box-shadow: 0 0 20px rgba(255,215,0,0.3), inset 0 0 10px rgba(255,215,0,0.1);
}
.entrance-banner.vip .ent-name { color: var(--gold); text-shadow: 0 0 5px rgba(255,215,0,0.5); font-size: 15px; }
.entrance-banner.vip .ent-desc { color: #fff; font-weight: bold; }

@keyframes slideInEntrance {
    0% { transform: translateX(120%) scale(0.9); opacity: 0; }
    10% { transform: translateX(0) scale(1); opacity: 1; }
    85% { transform: translateX(0) scale(1); opacity: 1; }
    100% { transform: translateX(-120%) scale(0.9); opacity: 0; }
}

/* ══════════════════════════════════
   MODALS & PANELS
══════════════════════════════════ */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); }
.modal-sheet { position: relative; z-index: 1; width: 100%; max-width: 480px; padding: 25px; padding-bottom: calc(25px + var(--safe-bot)); border-radius: 28px 28px 0 0; animation: slideUp 0.3s ease-out; background: var(--bg); border: 1px solid var(--glass-border); border-bottom: none; box-shadow: 0 -10px 40px rgba(0,0,0,0.6); max-height: 90vh; display: flex; flex-direction: column; }
.modal-handle { width: 44px; height: 5px; border-radius: 5px; background: rgba(255,255,255,0.2); margin: 0 auto 20px; }
.modal-sheet h3 { text-align: center; margin-bottom: 20px; font-size: 20px; font-weight: 800; }

.input-wrapper { position: relative; margin-bottom: 16px; width: 100%; }
.input-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 18px; z-index: 1; }
.input-wrapper input, .input-wrapper textarea { width: 100%; padding: 16px 48px 16px 16px; border-radius: 14px; border: 1px solid var(--glass-border); background: rgba(0,0,0,0.3); color: #fff; font-size: 15px; font-family: inherit; outline: none; transition: 0.3s; }
.input-wrapper input:focus, .input-wrapper textarea:focus { border-color: var(--primary); background: rgba(0,0,0,0.5); }
.input-wrapper textarea { resize: none; min-height: 90px; padding-top: 16px; }

.btn-ghost { width: 100%; padding: 14px; border: none; background: transparent; color: var(--text-muted); font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; margin-top: 8px; }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state span { font-size: 50px; display: block; margin-bottom: 15px; opacity: 0.8; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; font-size: 15px; font-weight: 700; }
.btn-sm { padding: 12px 24px; border: none; border-radius: 14px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 800; font-family: inherit; cursor: pointer; }

.color-picker p { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; font-weight: 700; }
.color-options { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 25px; }
.color-opt { width: 46px; height: 46px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: 0.2s; }
.color-opt.active { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 15px rgba(255,255,255,0.4); }

/* Room Image Upload */
.room-img-upload { width: 100%; height: 140px; background: rgba(0,0,0,0.3); border: 2px dashed rgba(255,255,255,0.2); border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; cursor: pointer; position: relative; overflow: hidden; }
#room-img-placeholder { color: var(--text-muted); font-size: 14px; font-weight: 700; pointer-events: none; }

/* Gifts Panel */
.gift-sheet { height: 60vh; }
.gifts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; overflow-y: auto; padding-bottom: 20px; padding-right: 5px; }
.gift-item { background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); border-radius: 16px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: 0.2s; }
.gift-item:active { transform: scale(0.95); background: rgba(255,255,255,0.1); }
.gift-thumb { width: 60px; height: 60px; object-fit: contain; margin-bottom: 8px; }
.gift-name { font-size: 12px; font-weight: 700; text-align: center; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

/* Admin Panel */
.admin-sheet { height: 85vh; }
.admin-tabs { display: flex; background: rgba(0,0,0,0.3); border-radius: 14px; padding: 4px; margin-bottom: 20px; }
.admin-tab-btn { flex: 1; padding: 12px; border: none; background: transparent; color: var(--text-muted); font-weight: 700; font-family: inherit; font-size: 14px; cursor: pointer; border-radius: 10px; transition: 0.3s; }
.admin-tab-btn.active { background: var(--bg-card); color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.admin-section { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding-right: 5px; }

.admin-add-gift { background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border); border-radius: 16px; padding: 16px; }
.admin-add-gift h4 { font-size: 15px; margin-bottom: 15px; color: var(--accent); }
.upload-row { display: flex; gap: 10px; margin-bottom: 10px; }
.upload-box { flex: 1; background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.2); padding: 12px; border-radius: 12px; text-align: center; cursor: pointer; font-size: 12px; color: var(--text-muted); }

.admin-gifts-list, .admin-users-list { display: flex; flex-direction: column; gap: 10px; }
.admin-gift-row, .admin-user-row { display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,0.3); padding: 12px; border-radius: 14px; border: 1px solid var(--glass-border); }
.admin-gift-thumb { width: 40px; height: 40px; object-fit: contain; margin-left: 10px; }
.btn-del { background: rgba(255,65,108,0.1); border: 1px solid rgba(255,65,108,0.3); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.admin-user-info { display: flex; align-items: center; gap: 12px; }
.admin-user-av { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.admin-user-name { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.admin-user-phone { font-size: 12px; color: var(--text-muted); direction: ltr; text-align: right; }
.admin-user-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.verified-small { font-size: 10px; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,0.1); color: var(--text-muted); }
.verified-small.on { background: rgba(0,255,136,0.1); color: var(--success); }
.btn-verify { padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--glass-border); color: #fff; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* ══════════════════════════════════
   TOAST & ERRORS
══════════════════════════════════ */
.toast { position: fixed; bottom: calc(100px + var(--safe-bot)); left: 50%; transform: translateX(-50%); background: rgba(255,255,255,0.15); backdrop-filter: blur(25px); color: #fff; padding: 14px 28px; border-radius: 20px; font-size: 15px; font-weight: 800; z-index: 500; animation: toastIn 0.3s cubic-bezier(0.1, 0.9, 0.2, 1); border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 15px 40px rgba(0,0,0,0.6); white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(30px) scale(0.9) } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1) } }

.phone-error-card { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(20, 5, 10, 0.95); backdrop-filter: blur(20px); border: 1px solid rgba(255, 65, 108, 0.3); padding: 30px; border-radius: 24px; z-index: 300; text-align: center; width: 90%; max-width: 320px; box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 40px rgba(255,65,108,0.2); animation: popIn 0.3s cubic-bezier(0.1, 0.9, 0.2, 1); }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -40%) scale(0.9) } to { opacity: 1; transform: translate(-50%, -50%) scale(1) } }
.pec-icon { font-size: 48px; margin-bottom: 15px; animation: shake 0.5s ease-in-out; }
@keyframes shake { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-15deg)} 75%{transform:rotate(15deg)} }
.phone-error-card h4 { color: var(--danger); font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.phone-error-card p { color: #ddd; font-size: 14px; margin-bottom: 10px; line-height: 1.5; }
.pec-hint { font-size: 16px !important; font-weight: 800; color: #fff !important; direction: ltr; background: rgba(255,255,255,0.05); padding: 8px; border-radius: 10px; margin-bottom: 20px !important; letter-spacing: 2px; }
.phone-error-card button { width: 100%; padding: 14px; background: var(--danger); border: none; border-radius: 14px; color: #fff; font-size: 16px; font-weight: 800; font-family: inherit; cursor: pointer; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

/* ══════════════════════════════════
   LEVELS & VIP
══════════════════════════════════ */
.level-badge { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #FF9A9E, #FECFEF); color: #B31217; font-size: 10px; font-weight: 900; padding: 2px 6px; border-radius: 8px; margin-right: 5px; border: 1px solid rgba(255,154,158,0.5); font-family: 'Arial', sans-serif; }
.level-badge.lv-high { background: linear-gradient(135deg, #a18cd1, #fbc2eb); color: #4B0082; border-color: rgba(161,140,209,0.5); }
.level-badge.lv-max { background: linear-gradient(135deg, #ff0844, #ffb199); color: #fff; border-color: rgba(255,8,68,0.8); box-shadow: 0 0 10px rgba(255,8,68,0.5); }

.vip-frame { position: relative; }
.vip-frame::before { content: ''; position: absolute; top: -10%; left: -10%; width: 120%; height: 120%; border-radius: 50%; background: linear-gradient(135deg, #f6d365, #fda085, #f6d365); z-index: 0; animation: spinVIP 3s linear infinite; mask-image: radial-gradient(circle, transparent 60%, black 62%); -webkit-mask-image: radial-gradient(circle, transparent 60%, black 62%); pointer-events: none; }
@keyframes spinVIP { 100% { transform: rotate(360deg); } }

.vip-entry-msg { 
  background: linear-gradient(90deg, rgba(246,211,101,0) 0%, rgba(246,211,101,0.3) 20%, rgba(253,160,133,0.8) 50%, rgba(246,211,101,0.3) 80%, rgba(246,211,101,0) 100%); 
  color: #fff; 
  padding: 12px 20px; 
  border-radius: 4px; 
  font-size: 14px; 
  font-weight: 800; 
  text-align: center; 
  border-top: 1px solid var(--gold); 
  border-bottom: 1px solid var(--gold); 
  box-shadow: 0 0 30px rgba(253,160,133,0.4); 
  animation: tiktokEntry 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, fadeOutVIP 0.5s 4.5s forwards; 
  text-shadow: 0 2px 4px rgba(0,0,0,0.8); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 10px; 
  margin: 15px auto; 
  width: 95%; 
  position: relative;
  overflow: hidden;
}
.vip-entry-msg::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shineEntry 2s infinite;
}
@keyframes tiktokEntry {
  0% { transform: translateX(100%) skewX(-20deg); opacity: 0; }
  70% { transform: translateX(-5%) skewX(0deg); opacity: 1; }
  100% { transform: translateX(0) skewX(0deg); opacity: 1; }
}
@keyframes shineEntry {
  to { left: 100%; }
}
@keyframes fadeOutVIP { to { opacity: 0; transform: scale(0.9); height: 0; margin: 0; padding: 0; border: none; } }

/* ══════════════════════════════════
   STORE UI
══════════════════════════════════ */
.store-nav { border-bottom: 1px solid rgba(255,255,255,0.1); }
.store-tab-btn { background: transparent; border: none; color: rgba(255,255,255,0.5); font-size: 14px; font-weight: 700; padding: 10px 15px; border-radius: 20px; white-space: nowrap; cursor: pointer; transition: 0.3s; }
.store-tab-btn.active { background: rgba(255,255,255,0.1); color: #fff; box-shadow: inset 0 0 10px rgba(255,255,255,0.05); }
.store-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.store-item { background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 20px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; transition: transform 0.2s, box-shadow 0.2s; position: relative; overflow: hidden; backdrop-filter: blur(10px); }
.store-item::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.store-item:hover::before { opacity: 1; }
.store-item:active { transform: scale(0.95); }
.store-item-preview { width: 90px; height: 90px; border-radius: 50%; margin-bottom: 15px; display: flex; justify-content: center; align-items: center; position: relative; background: rgba(0,0,0,0.3); box-shadow: inset 0 0 15px rgba(0,0,0,0.5); }
.mock-avatar { width: 60px; height: 60px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: #fff; }
.frame-neon { border: 3px solid #00f3ff; box-shadow: 0 0 15px #00f3ff; }
.frame-royal { border: 3px solid #ffd700; box-shadow: 0 0 15px #ffd700; }
.frame-fire { border: 3px dashed #ff4500; box-shadow: 0 0 15px #ff4500, inset 0 0 10px #ff4500; }
.store-item-name { font-size: 16px; font-weight: 900; color: #fff; margin-bottom: 5px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.store-item-price { font-size: 14px; color: var(--gold); font-weight: 800; margin-bottom: 15px; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.btn-buy { background: linear-gradient(135deg, var(--primary), #8a2be2); border: none; color: #fff; padding: 10px 24px; border-radius: 20px; font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 15px rgba(102,126,234,0.4); transition: 0.2s; width: 80%; }
.btn-buy:active { transform: scale(0.9); }

/* Verified Icon */
.verified-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231DA1F2'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
  background-size: cover;
  vertical-align: middle;
  margin-right: 4px;
}

/* Level Card (for modal) */
.level-card {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 12px 16px;
  transition: transform 0.2s;
}
.level-card:hover { transform: scale(1.02); background: rgba(255,255,255,0.08); }
.level-card img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-left: 15px;
}
.level-info h4 { margin: 0 0 5px 0; color: #fff; font-size: 16px; }
.level-info p { margin: 0; color: var(--text-muted); font-size: 13px; font-weight: 600; }


/* Welcome notice in rooms */
.welcome-notice {
  text-align: center;
  padding: 8px 16px;
  margin: 10px 16px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

/* ══════════════════════════════════
   🎨 MODERN UI OVERHAUL 2026
══════════════════════════════════ */

/* Material Symbols Base */
.material-icons {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  font-size: 24px;
  vertical-align: middle;
  line-height: 1;
}

/* ── Modern Bottom Nav ── */
#bottom-nav {
  background: rgba(6,7,26,0.92);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
}
.nav-item {
  gap: 6px;
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.2s;
}
.nav-item .nav-icon {
  width: 26px;
  height: 26px;
  color: var(--text-hint);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom center;
}
.nav-item.active .nav-icon {
  color: transparent;
  stroke: url(#nav-grad-active);
  filter: drop-shadow(0 0 6px var(--primary-glow));
  transform: translateY(-4px) scale(1.15);
}
.nav-item.active .icon-bg {
  fill: url(#nav-grad-active);
  fill-opacity: 0.2;
}
.nav-item.active {
  color: var(--primary-light);
  font-weight: 800;
}
.nav-item.active::after {
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: var(--gradient-primary);
  box-shadow: 0 0 12px var(--primary-glow);
  bottom: 8px;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-item:active { transform: scale(0.9); }

/* ── Modern Coins Badge ── */
.coins-badge {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  padding: 8px 18px;
  border-radius: 24px;
  font-weight: 900;
  font-size: 15px;
  color: var(--gold);
  border: 1px solid rgba(255,215,0,0.25);
  box-shadow: 0 0 15px rgba(255,215,0,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
  letter-spacing: 0.5px;
}

/* ── Modern Buttons ── */
.btn-modern {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px;
  border: none;
  border-radius: 24px;
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}
.btn-modern::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-modern:hover::after { opacity: 1; }
.btn-modern:active { transform: scale(0.95); }
.btn-modern .material-icons { font-size: 20px; }

.btn-store {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #000;
  box-shadow: 0 4px 20px rgba(245,158,11,0.4);
}
.btn-store:hover { box-shadow: 0 6px 25px rgba(245,158,11,0.6); }

/* ── Modern Glass Cards ── */
.glass-card {
  background: rgba(15,18,40,0.85);
  backdrop-filter: blur(25px) saturate(150%);
  -webkit-backdrop-filter: blur(25px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ── Modern Modal Sheets ── */
.modal-sheet {
  background: linear-gradient(180deg, rgba(20,22,50,0.98) 0%, rgba(10,12,30,0.99) 100%);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: modalSlideUp 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes modalSlideUp {
  from { transform: translateY(100%); opacity: 0.5; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-overlay {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.modal-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  margin: 0 auto 20px;
}

/* ── Modern Room Cards ── */
.room-card-pro {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
  overflow: hidden;
}
.room-card-pro:hover {
  border-color: rgba(168,85,247,0.3);
  box-shadow: 0 8px 30px rgba(168,85,247,0.15);
}
.room-card-pro:active { transform: scale(0.97); }

/* ── Modern Auth Buttons ── */
.btn-auth {
  background: var(--gradient-primary);
  box-shadow: 0 6px 25px var(--primary-glow);
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.btn-auth::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}
.btn-auth:hover::before { left: 100%; }
.btn-auth:active { transform: scale(0.97); box-shadow: 0 3px 15px var(--primary-glow); }

/* ── Modern Inputs ── */
.auth-input, .phone-input {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  transition: all 0.3s ease;
}
.auth-input:focus, .phone-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15);
  background: rgba(255,255,255,0.06);
}

/* ── Profile Frame (Circles for Reels & Rooms) ── */
.profile-avatar, .mic-avatar, .reel-avatar, .user-card-avatar, .profile-avatar-large {
  border-radius: 50% !important;
  overflow: hidden;
}
.mic-avatar {
  border: 2.5px solid rgba(255,255,255,0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.premium-mic.active .mic-avatar {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}
/* Speaking mic styles are defined above in the Speaking State section */

/* ── Modern Toast ── */
.toast {
  background: rgba(15,18,40,0.9);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  padding: 14px 28px;
  font-weight: 800;
  font-size: 14px;
  animation: toastModern 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes toastModern {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ── Modern Store Items ── */
.store-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 24px 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.store-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(168,85,247,0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.btn-buy {
  background: var(--gradient-primary);
  border-radius: 14px;
  padding: 10px 24px;
  font-weight: 800;
  transition: all 0.3s;
  box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-buy:hover { box-shadow: 0 6px 20px rgba(168,85,247,0.5); }

/* ── Modern Gift Panel ── */
.gift-item {
  border-radius: 18px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255,255,255,0.05);
}
.gift-item:hover {
  background: rgba(255,255,255,0.08);
  transform: scale(1.05);
  border-color: rgba(168,85,247,0.3);
}

/* ── Modern Message Items ── */
.msg-room-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.msg-room-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(168,85,247,0.2);
}

/* ── Smooth Page Transitions ── */
.tab-content {
  transition: opacity 0.3s ease;
}
.tab-content.active {
  animation: fadeInTab 0.35s ease-out;
}
@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Premium Header in Rooms ── */
.premium-header {
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 70%, transparent 100%);
}

/* ── Modern Create Room Button ── */
.btn-create-room {
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.4);
  color: var(--primary-light);
  border-radius: 14px;
  padding: 10px 18px;
  font-weight: 800;
  transition: all 0.3s;
}
.btn-create-room:hover {
  background: rgba(168,85,247,0.2);
  box-shadow: 0 4px 15px rgba(168,85,247,0.2);
}

/* ── Modern Color Scheme Updates ── */
.nav-item.active::after {
  background: var(--gradient-primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* ── Responsive Improvements ── */
@media (max-width: 380px) {
  .rooms-grid-pro { grid-template-columns: 1fr; }
  .gifts-grid { grid-template-columns: repeat(3, 1fr); }
  .store-grid { grid-template-columns: 1fr; }
}
@media (min-width: 600px) {
  .rooms-grid-pro { grid-template-columns: repeat(3, 1fr); }
  .modal-sheet { max-width: 500px; margin: 0 auto; }
}
@media (min-width: 900px) {
  .rooms-grid-pro { grid-template-columns: repeat(4, 1fr); }
  .tab-header h1 { font-size: 30px; }
}

/* ── Modern Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb {
  background: rgba(168,85,247,0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(168,85,247,0.4);
}

/* ── Level Badge Modern ── */
.level-badge {
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(236,72,153,0.2));
  color: var(--primary-light);
  border: 1px solid rgba(168,85,247,0.3);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
}

/* ── Premium Chat Bubbles ── */
.msg-content-wrap {
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.live-msg.me .msg-content-wrap {
  background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(236,72,153,0.2));
  border-color: rgba(168,85,247,0.3);
}

/* ── Premium Send Button ── */
.send-glow-btn {
  background: var(--gradient-primary);
  box-shadow: 0 0 15px var(--primary-glow);
  transition: all 0.3s;
}
.send-glow-btn:hover {
  box-shadow: 0 0 25px rgba(168,85,247,0.6);
}

/* ── Skeleton Loading Shimmer ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

/* ══════════════════════════════════════════════════════
   🖼️ GLOBAL AVATAR FRAME SYSTEM — Professional Grade
   Unified frame rendering for all avatar sizes & contexts
══════════════════════════════════════════════════════ */

/* Base container — must be used on the avatar's parent wrapper */
.avatar-frame-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* The actual avatar circle inside the wrapper */
.avatar-frame-wrap .avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 1;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
}

/* The frame image overlay — perfectly centered around avatar */
.avatar-frame-wrap .avatar-frame-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 142%;
  height: 142%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

/* Frame entrance animation — plays once on load */
.avatar-frame-wrap .avatar-frame-img.frame-enter {
  animation: frameReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes frameReveal {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(0.6) rotate(-15deg); }
  50% { opacity: 1; transform: translate(-50%,-50%) scale(1.08) rotate(3deg); }
  100% { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0deg); }
}

/* Subtle idle pulse for premium feel */
.avatar-frame-wrap.frame-glow .avatar-frame-img {
  animation: frameIdlePulse 3s ease-in-out infinite;
}
@keyframes frameIdlePulse {
  0%, 100% { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)) drop-shadow(0 0 4px rgba(168,85,247,0.15)); }
  50% { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)) drop-shadow(0 0 12px rgba(168,85,247,0.35)); }
}

/* ── Size Variants ── */

/* XS: Chat messages (34px) */
.avatar-frame-wrap.frame-xs {
  width: 34px; height: 34px;
}
.avatar-frame-wrap.frame-xs .avatar-inner {
  border: 2px solid rgba(255,255,255,0.2);
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* SM: Reels, Entrance Banner, Conversations (40px) */
.avatar-frame-wrap.frame-sm {
  width: 40px; height: 40px;
}
.avatar-frame-wrap.frame-sm .avatar-inner {
  border: 2px solid rgba(255,255,255,0.2);
  font-size: 15px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

/* MD: Mic slots (clamp 50-65px responsive) */
.avatar-frame-wrap.frame-md {
  width: 15vw; height: 15vw;
  max-width: 65px; max-height: 65px;
}
.avatar-frame-wrap.frame-md .avatar-inner {
  border: 2.5px solid rgba(255,255,255,0.15);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

/* LG: User Card (90px) */
.avatar-frame-wrap.frame-lg {
  width: 90px; height: 90px;
}
.avatar-frame-wrap.frame-lg .avatar-inner {
  border: 3px solid rgba(255,255,255,0.12);
  font-size: 36px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* XL: Profile Page (100px) */
.avatar-frame-wrap.frame-xl {
  width: 100px; height: 100px;
}
.avatar-frame-wrap.frame-xl .avatar-inner {
  border: 4px solid rgba(15,18,40,0.8);
  font-size: 40px;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* XXL: Full Profile View (120px) */
.avatar-frame-wrap.frame-xxl {
  width: 120px; height: 120px;
}
.avatar-frame-wrap.frame-xxl .avatar-inner {
  border: 5px solid var(--bg);
  font-size: 50px;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Header avatar (46px) */
.avatar-frame-wrap.frame-header {
  width: 46px; height: 46px;
}
.avatar-frame-wrap.frame-header .avatar-inner {
  border: 2px solid rgba(255,255,255,0.12);
  font-size: 18px;
  font-weight: 800;
}

/* MSG conversation list (55px) */
.avatar-frame-wrap.frame-conv {
  width: 55px; height: 55px;
}
.avatar-frame-wrap.frame-conv .avatar-inner {
  border: 2px solid rgba(255,255,255,0.1);
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  border-radius: 20px;
}

/* ── Entrance Banner — Frame in Room Entry ── */
.entrance-banner .ent-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.entrance-banner .ent-avatar-wrap .ent-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--primary);
  border: 2px solid rgba(255,255,255,0.2);
  position: relative;
  z-index: 1;
}
.entrance-banner .ent-avatar-wrap .ent-frame-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 142%;
  height: 142%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4));
  animation: frameRevealEntrance 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes frameRevealEntrance {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(0.5); }
  100% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

/* VIP entrance with golden frame glow */
.entrance-banner.vip .ent-avatar-wrap .ent-frame-img {
  filter: drop-shadow(0 0 8px rgba(255,215,0,0.5)) drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.entrance-banner.vip .ent-avatar-wrap .ent-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  border-width: 3px;
}

/* ── Mic Slot Frame Override (legacy compat) ── */
.mic-avatar {
  overflow: visible !important;
}
.mic-avatar .mic-frame-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 142%;
  height: 142%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
  transition: opacity 0.3s ease;
}

/* Mic frame glow when speaking */
.premium-mic.speaking .mic-avatar .mic-frame-overlay {
  filter: drop-shadow(0 0 10px rgba(168,85,247,0.5)) drop-shadow(0 0 6px rgba(236,72,153,0.3)) drop-shadow(0 2px 6px rgba(0,0,0,0.4));
  animation: frameGlowPulse 1.5s ease-in-out infinite alternate;
}
@keyframes frameGlowPulse {
  0% { filter: drop-shadow(0 0 8px rgba(168,85,247,0.4)) drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
  100% { filter: drop-shadow(0 0 14px rgba(236,72,153,0.5)) drop-shadow(0 0 8px rgba(6,214,160,0.3)) drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
}

/* ── Profile Page Frame Enhancement ── */
#profile-frame-img {
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.profile-avatar-wrap:hover #profile-frame-img {
  filter: drop-shadow(0 4px 16px rgba(168,85,247,0.3)) drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

/* ── Profile Avatar Large (Full Profile) Frame Enhancement ── */
.profile-avatar-large {
  overflow: visible !important;
}
.profile-avatar-large .profile-large-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 142%;
  height: 142%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 4px 15px rgba(0,0,0,0.5));
  animation: frameReveal 0.8s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── User Card Avatar Frame Enhancement ── */
.user-card-avatar {
  overflow: visible !important;
}
.user-card-avatar .usercard-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 142%;
  height: 142%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,0.5));
  animation: frameReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Chat Message Avatar Frame ── */
.msg-avatar {
  overflow: visible !important;
}
.msg-avatar .chat-frame-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 142%;
  height: 142%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.3));
}

/* ── Reel Avatar Frame ── */
.reel-user .reel-frame-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 142%;
  height: 142%;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* ── Responsive Frame Adjustments ── */
@media (max-width: 360px) {
  .avatar-frame-wrap.frame-xl { width: 85px; height: 85px; }
  .avatar-frame-wrap.frame-xxl { width: 100px; height: 100px; }
  .avatar-frame-wrap.frame-md { max-width: 55px; max-height: 55px; }
  .entrance-banner .ent-avatar-wrap { width: 36px; height: 36px; }
}
@media (min-width: 768px) {
  .avatar-frame-wrap.frame-md { max-width: 72px; max-height: 72px; }
  .avatar-frame-wrap.frame-xl { width: 110px; height: 110px; }
  .avatar-frame-wrap.frame-xxl { width: 140px; height: 140px; }
}


.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  display: inline-block;
}
