/* =============================================
   IRAQ LOVE CHAT - Premium Dark Theme CSS
   style.css - Core Design System
   ============================================= */

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

/* ── CSS Variables ── */
:root {
  --bg-deep:        #07070f;
  --bg-dark:        #0d0d1e;
  --bg-card:        rgba(255,255,255,0.04);
  --bg-card-hover:  rgba(255,255,255,0.08);
  --border:         rgba(255,255,255,0.09);
  --border-glow:    rgba(180,100,255,0.35);

  --accent:         #8b5cf6;
  --accent2:        #ec4899;
  --accent-gold:    #f59e0b;
  --accent-emerald: #10b981;
  --accent-orange:  #f97316;

  --text-primary:   #f0f0ff;
  --text-secondary: #9090b8;
  --text-muted:     #5a5a80;

  --owner-color:    #f97316;
  --admin-color:    #f59e0b;
  --mod-color:      #10b981;
  --system-bg:      rgba(139,92,246,0.12);

  --shadow-glow:    0 0 40px rgba(139,92,246,0.2);
  --shadow-card:    0 8px 32px rgba(0,0,0,0.5);
  --radius-lg:      18px;
  --radius-md:      12px;
  --radius-sm:      8px;

  --transition:     all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', 'Outfit', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(139,92,246,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 90%, rgba(236,72,153,0.09) 0%, transparent 60%);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 99px;
}

/* ── Animated Background Stars ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 70%, rgba(255,255,255,0.10) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 15%, rgba(255,255,255,0.12) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,0.08) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 85%, rgba(255,255,255,0.10) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════
   LANDING PAGE (index.php)
══════════════════════════════ */

/* ── BANNER ── */
.site-banner {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #0f0826 0%, #1a0a35 40%, #0a1230 100%);
  border-bottom: 1px solid var(--border-glow);
  overflow: hidden;
  padding: 0 0 8px;
  z-index: 10;
  box-shadow: 0 4px 40px rgba(139,92,246,0.25);
}

.banner-particles {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(139,92,246,0.25) 0%, transparent 40%),
    radial-gradient(circle at 85% 50%, rgba(236,72,153,0.20) 0%, transparent 40%);
  pointer-events: none;
}

.banner-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 20px 10px;
  position: relative; z-index: 1;
}

.banner-crown {
  font-size: 38px;
  filter: drop-shadow(0 0 16px rgba(245,158,11,0.8));
  animation: floatCrown 3s ease-in-out infinite;
}
@keyframes floatCrown {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-6px) rotate(5deg); }
}

.banner-title {
  font-size: clamp(22px, 5vw, 44px);
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #f97316, #ec4899, #8b5cf6, #3b82f6, #10b981, #f97316);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerTitle 4s linear infinite;
  text-shadow: none;
  white-space: nowrap;
}
@keyframes shimmerTitle {
  0%   { background-position: 0% center; }
  100% { background-position: 300% center; }
}

/* ── Banner Nav Tabs ── */
.banner-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 20px 4px;
  position: relative; z-index: 1;
}

.banner-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 20px;
  border-radius: 99px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  backdrop-filter: blur(6px);
}
.banner-nav-item:hover,
.banner-nav-item.active {
  background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(236,72,153,0.2));
  border-color: var(--border-glow);
  color: #fff;
  box-shadow: 0 0 20px rgba(139,92,246,0.3);
  transform: translateY(-2px);
}
.banner-nav-item .icon { font-size: 16px; }

/* ── Main Landing Container ── */
.landing-wrap {
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  position: relative; z-index: 1;
}

.landing-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  overflow: hidden;
}

.landing-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.landing-tab {
  flex: 1;
  padding: 16px 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  background: none; border: none;
  outline: none;
  border-bottom: 3px solid transparent;
  font-family: 'Tajawal', sans-serif;
}
.landing-tab:hover { color: var(--text-secondary); background: rgba(255,255,255,0.03); }
.landing-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(139,92,246,0.06);
}

.landing-body { padding: 30px 28px; }

.landing-panel { display: none; }
.landing-panel.active { display: block; animation: fadeSlideIn 0.35s ease; }
@keyframes fadeSlideIn {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}

.panel-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.panel-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

/* ── Form Elements ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}
.form-input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'Tajawal', sans-serif;
  outline: none;
  transition: var(--transition);
  direction: rtl;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
  border-color: var(--accent);
  background: rgba(139,92,246,0.08);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 99px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(139,92,246,0.4);
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(139,92,246,0.6); transform: translateY(-2px); }

.btn-guest {
  width: 100%;
  background: linear-gradient(135deg, #1e1e3a, #2a1a4a);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-guest:hover { border-color: var(--border-glow); color: #fff; transform: translateY(-2px); }

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
}
.btn-danger  { background: linear-gradient(135deg,#dc2626,#991b1b); color:#fff; }
.btn-warning { background: linear-gradient(135deg,#d97706,#92400e); color:#fff; }
.btn-success { background: linear-gradient(135deg,#059669,#065f46); color:#fff; }
.btn-info    { background: linear-gradient(135deg,#2563eb,#1d4ed8); color:#fff; }
.btn-purple  { background: linear-gradient(135deg,var(--accent),#7c3aed); color:#fff; }
.btn-sm:hover { transform: translateY(-1px); filter: brightness(1.15); }

/* ── Alert / Toast ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeSlideIn 0.3s ease;
  border: 1px solid transparent;
}
.alert-error   { background: rgba(220,38,38,0.15); border-color: rgba(220,38,38,0.4); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.4); color: #6ee7b7; }
.alert-info    { background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.4); color: #c4b5fd; }
.alert-warn    { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.4); color: #fcd34d; }
.alert-hidden  { display: none; }

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════
   CHAT ROOM PAGE (chat.php)
══════════════════════════════ */

.chat-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto 1fr;
  height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  position: relative; z-index: 1;
  gap: 0;
}

/* ── Sidebar (User List) ── */
.chat-sidebar {
  grid-row: 1 / 3;
  background: rgba(0,0,0,0.35);
  border-left: 1px solid var(--border);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.6; transform:scale(1.3); }
}

.online-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(16,185,129,0.2);
  color: var(--accent-emerald);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  margin-right: auto;
}

.users-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
}
.user-item:hover { background: var(--bg-card-hover); }
.user-item.is-admin-panel-target { background: rgba(139,92,246,0.12); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
}
.user-avatar.role-owner    { background: linear-gradient(135deg,#f97316,#dc2626); box-shadow:0 0 12px rgba(249,115,22,0.5); }
.user-avatar.role-admin    { background: linear-gradient(135deg,#f59e0b,#d97706); box-shadow:0 0 10px rgba(245,158,11,0.4); }
.user-avatar.role-moderator{ background: linear-gradient(135deg,#10b981,#059669); box-shadow:0 0 10px rgba(16,185,129,0.4); }
.user-avatar.role-member   { background: linear-gradient(135deg,#6366f1,#4f46e5); }
.user-avatar.role-guest    { background: rgba(255,255,255,0.1); }

.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-badge {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
}

/* Name Colors */
.name-owner     { color: var(--owner-color) !important; }
.name-admin     { color: var(--admin-color) !important; }
.name-moderator { color: var(--mod-color)   !important; }

/* ── Chat Main Area ── */
.chat-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Chat Header ── */
.chat-header {
  padding: 12px 20px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.chat-room-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.chat-room-name { font-size: 16px; font-weight: 800; }
.chat-room-desc { font-size: 12px; color: var(--text-muted); }

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

/* ── Messages Container ── */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}

/* ── Message Bubble ── */
.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: msgIn 0.25s ease;
  padding: 2px 0;
}
@keyframes msgIn {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-body { flex: 1; min-width: 0; }

.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.msg-username {
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.msg-username:hover { text-decoration: underline; }

.msg-role-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge-owner     { background: rgba(249,115,22,0.2); color: var(--owner-color); border:1px solid rgba(249,115,22,0.3); }
.badge-admin     { background: rgba(245,158,11,0.2); color: var(--admin-color); border:1px solid rgba(245,158,11,0.3); }
.badge-moderator { background: rgba(16,185,129,0.2); color: var(--mod-color);   border:1px solid rgba(16,185,129,0.3); }
.badge-member    { background: rgba(99,102,241,0.2); color: #818cf8;             border:1px solid rgba(99,102,241,0.3); }
.badge-guest     { background: rgba(255,255,255,0.06); color: var(--text-muted); border:1px solid var(--border); }

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-right: auto;
}

.msg-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
}

/* ── Message Font Sizes ── */
html.size-small .msg-text, body.size-small .msg-text { font-size: 11px; }
html.size-normal .msg-text, body.size-normal .msg-text { font-size: 14px; }
html.size-large .msg-text, body.size-large .msg-text { font-size: 18px; }
html.size-xlarge .msg-text, body.size-xlarge .msg-text { font-size: 22px; }

/* ── Font Size Control Button Active State ── */
.font-size-btn.active {
  background: linear-gradient(135deg, var(--accent2), var(--accent)) !important;
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.4);
}

/* System Messages */
.msg-row.system .msg-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 8px 14px;
  background: var(--system-bg);
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--accent);
  margin: 4px 0;
}
.msg-row.system .msg-meta { display:none; }
.msg-row.system .msg-avatar { display:none; }

/* Right-click / Context Action */
.msg-delete-btn {
  opacity: 0;
  transition: opacity 0.2s;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(220,38,38,0.15);
  color: #fca5a5;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-family: 'Tajawal', sans-serif;
}
.msg-row:hover .msg-delete-btn { opacity: 1; }

/* ── Input Area ── */
.chat-input-area {
  position: relative;
  padding: 14px 20px;
  background: rgba(0,0,0,0.25);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.msg-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 12px 20px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Tajawal', sans-serif;
  outline: none;
  transition: var(--transition);
  direction: rtl;
}
.msg-input::placeholder { color: var(--text-muted); }
.msg-input:focus {
  border-color: var(--accent);
  background: rgba(139,92,246,0.08);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.msg-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255,0,0,0.05);
  border-color: rgba(220,38,38,0.3);
}

.send-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: var(--transition);
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(139,92,246,0.4);
}
.send-btn:hover { transform: scale(1.1); box-shadow: 0 6px 25px rgba(139,92,246,0.6); }
.send-btn:active { transform: scale(0.95); }

/* ── Muted Notice ── */
.muted-notice {
  display: none;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  color: #fca5a5;
  background: rgba(220,38,38,0.10);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

/* ══════════════════════════════
   ADMIN PANEL OVERLAY
══════════════════════════════ */

.admin-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.3s ease;
}
.admin-overlay.hidden { display: none; }

@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.admin-panel {
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  background: #0f0f20;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 80px rgba(0,0,0,0.7), 0 0 60px rgba(139,92,246,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpPanel 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes slideUpPanel {
  from { opacity:0; transform:scale(0.92) translateY(30px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

.admin-panel-header {
  padding: 20px 24px;
  background: linear-gradient(135deg,rgba(139,92,246,0.15),rgba(236,72,153,0.10));
  border-bottom: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-panel-title {
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(90deg,var(--accent),var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.admin-close-btn {
  margin-right: auto;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
}
.admin-close-btn:hover { background: rgba(220,38,38,0.2); color: #fca5a5; border-color: rgba(220,38,38,0.4); }

.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.admin-tab {
  flex: 1;
  padding: 13px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: 'Tajawal', sans-serif;
}
.admin-tab:hover { color: var(--text-secondary); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-body { flex:1; overflow-y:auto; padding:20px 24px; }

.admin-section { display: none; }
.admin-section.active { display: block; animation: fadeSlideIn 0.3s ease; }

/* Members Table */
.members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.members-table th {
  text-align: right;
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
}
.members-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.members-table tr:hover td { background: rgba(255,255,255,0.03); }

.actions-cell { display: flex; gap: 5px; flex-wrap: wrap; }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-online  { background:rgba(16,185,129,0.2); color:var(--accent-emerald); }
.status-offline { background:rgba(255,255,255,0.06); color:var(--text-muted); }
.status-banned  { background:rgba(220,38,38,0.2); color:#fca5a5; }
.status-muted   { background:rgba(245,158,11,0.2); color:#fcd34d; }

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e1e3a;
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  padding: 14px 24px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 20px rgba(139,92,246,0.2);
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.175,0.885,0.32,1.275), opacity 0.3s;
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Section Cards ── */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}
.section-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Modal (for competitions/articles/games) ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: #0f0f20;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 80px rgba(0,0,0,0.7);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: slideUpPanel 0.3s ease;
}
.modal-header {
  padding: 18px 22px;
  background: linear-gradient(135deg,rgba(139,92,246,0.12),rgba(236,72,153,0.08));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close {
  margin-right: auto;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  transition: var(--transition);
}
.modal-close:hover { color: #fff; }
.modal-body { flex:1; overflow-y:auto; padding: 22px; }

/* ── Games ── */
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  max-width: 260px;
  margin: 20px auto;
}
.ttt-cell {
  aspect-ratio: 1;
  background: rgba(255,255,255,0.06);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  cursor: pointer;
  transition: var(--transition);
}
.ttt-cell:hover:not(.taken) {
  background: rgba(139,92,246,0.15);
  border-color: var(--accent);
}
.ttt-cell.taken { cursor: default; }
.ttt-status {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 10px 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .chat-sidebar {
    grid-row: auto;
    height: 120px;
    flex-direction: row;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-header { padding: 10px; border-bottom:none; border-left: 1px solid var(--border); }
  .users-list { flex-direction: row; display: flex; padding: 8px 4px; overflow-x: auto; overflow-y: hidden; }
  .user-item { flex-direction: column; min-width: 60px; text-align: center; padding: 6px; }
  .user-info { display: none; }
  .members-table { font-size: 12px; }
  .actions-cell { flex-direction: column; }
}

/* ── Appended Features Styles ── */

/* My Badge Chip */
.my-badge-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Header Action Button with badge */
.header-icon-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 16px;
  position: relative;
  transition: var(--transition);
}
.header-icon-btn:hover {
  background: rgba(139,92,246,0.15);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent2);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  border-radius: 99px;
  padding: 2px 5px;
  min-width: 16px;
  text-align: center;
  border: 1px solid var(--bg-body);
}

/* Room Selector */
.room-selector {
  position: relative;
  margin-right: 12px;
}
.room-selector-btn {
  background: linear-gradient(135deg,rgba(139,92,246,0.15),rgba(236,72,153,0.15));
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 13px;
  transition: var(--transition);
}
.room-selector-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(139,92,246,0.3);
}
.room-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #0f0f20;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  min-width: 180px;
  display: none;
  flex-direction: column;
  z-index: 900;
  overflow: hidden;
}
.room-dropdown.show {
  display: flex;
}
.room-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Tajawal', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-align: right;
  transition: var(--transition);
}
.room-option:hover:not(:disabled) {
  background: rgba(139,92,246,0.12);
  color: #fff;
}
.room-option.active {
  background: rgba(139,92,246,0.2);
  color: var(--accent-gold);
  font-weight: 700;
}
.room-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.room-lock {
  margin-right: auto;
  font-size: 10px;
}

/* Notifications Dropdown Panel */
.notif-dropdown {
  position: fixed;
  top: 70px;
  left: 120px;
  width: 320px;
  max-height: 400px;
  background: #0f0f20;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  animation: slideUpPanel 0.25s ease;
}
.notif-dropdown.show {
  display: flex;
}
.notif-dropdown-header {
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
}
.notif-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notif-item:hover {
  background: rgba(255,255,255,0.02);
}
.notif-item.unread {
  background: rgba(139,92,246,0.05);
}
.notif-item-time {
  font-size: 9px;
  color: var(--text-muted);
  align-self: flex-end;
}

/* Emoji Picker */
.emoji-picker {
  position: absolute;
  bottom: 100%;
  right: 20px;
  background: #0f0f20;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  width: 320px;
  height: 240px;
  display: none;
  flex-direction: column;
  z-index: 950;
  overflow: hidden;
  margin-bottom: 8px;
}
.emoji-picker.show {
  display: flex;
}
.emoji-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.emoji-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
}
.emoji-tab:hover {
  background: rgba(255,255,255,0.04);
}
.emoji-tab.active {
  border-bottom-color: var(--accent);
  background: rgba(139,92,246,0.1);
}
.emoji-grid {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.emoji-item {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}
.emoji-item:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.15);
}

.emoji-toggle-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0 10px;
  transition: var(--transition);
}
.emoji-toggle-btn:hover {
  transform: scale(1.15);
}

/* Mobile Toggle Styles */
.mobile-sidebar-toggle {
  display: none;
  margin-left: 12px;
}

@media (max-width: 768px) {
  .mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
  }
  .notif-dropdown {
    left: 20px;
    right: 20px;
    width: auto;
  }
  .room-dropdown {
    left: auto;
    right: 50%;
    transform: translateX(50%);
  }
}

/* ── Font Changer Panel Styles ── */
.font-dropdown-panel {
  position: fixed;
  top: 70px;
  left: 80px;
  width: 220px;
  background: #0f0f20;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  animation: slideUpPanel 0.25s ease;
}
.font-dropdown-panel.show {
  display: flex;
}
.font-dropdown-header {
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  text-align: center;
}
.font-dropdown-list {
  display: flex;
  flex-direction: column;
}
.font-option-btn {
  padding: 11px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  text-align: right;
  transition: var(--transition);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.font-option-btn:last-child {
  border-bottom: none;
}
.font-option-btn:hover {
  background: rgba(139,92,246,0.1);
  color: #fff;
}
.font-option-btn.active {
  background: rgba(139,92,246,0.2);
  color: var(--accent-gold);
  font-weight: 700;
}

/* ── Global Font Hooks ── */
body.font-tajawal, body.font-tajawal *,
html.font-tajawal, html.font-tajawal * {
  font-family: 'Tajawal', sans-serif !important;
}
body.font-cairo, body.font-cairo *,
html.font-cairo, html.font-cairo * {
  font-family: 'Cairo', sans-serif !important;
}
body.font-amiri, body.font-amiri *,
html.font-amiri, html.font-amiri * {
  font-family: 'Amiri', serif !important;
}
body.font-changa, body.font-changa *,
html.font-changa, html.font-changa * {
  font-family: 'Changa', sans-serif !important;
}

@media (max-width: 768px) {
  .font-dropdown-panel {
    left: 20px;
    right: 20px;
    width: auto;
  }
}

/* ═══════════════════════════════════
   ADDITIONAL FEATURES CSS
═══════════════════════════════════ */

/* ── PM Delete Conversation Button ── */
.pm-delete-conv-btn {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  background: rgba(220,38,38,0.15);
  border: 1px solid rgba(220,38,38,0.25);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  line-height: 1;
}
.pm-conv-item:hover .pm-delete-conv-btn { opacity: 1; }
.pm-delete-conv-btn:hover { background: rgba(220,38,38,0.3); }

/* ── @mention highlight ── */
.mention-highlight {
  color: var(--accent-gold);
  font-weight: 800;
  background: rgba(245,158,11,0.12);
  border-radius: 4px;
  padding: 0 3px;
}

/* ── User-is-me (sidebar) ── */
.user-item.is-me {
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.18);
  border-radius: var(--radius-sm);
}

/* ── Delete avatar button ── */
.delete-avatar-btn {
  background: rgba(220,38,38,0.12);
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: 8px;
  color: #fca5a5;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Tajawal', sans-serif;
}
.delete-avatar-btn:hover {
  background: rgba(220,38,38,0.25);
  color: #fff;
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Moving Blue (Owner) ── */
.moving-blue-text {
  background: linear-gradient(90deg, #00bcff, #00f0ff, #0077ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: moveBlue 2.5s linear infinite;
}
@keyframes moveBlue {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Owner glow */
.owner-name-glow { filter: drop-shadow(0 0 4px rgba(0, 188, 255, 0.5)); }

/* Admin gold */
.admin-name-gold {
  color: var(--admin-color) !important;
  text-shadow: 0 0 6px rgba(245,158,11,0.4);
}

/* Mod emerald */
.mod-name-emerald {
  color: var(--mod-color) !important;
  text-shadow: 0 0 6px rgba(16,185,129,0.4);
}

/* Name member */
.name-member { color: #a5b4fc !important; }

/* Mobile sidebar show */
@media (max-width: 768px) {
  .chat-sidebar.show-mobile {
    display: flex !important;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 260px;
    z-index: 800;
    background: #0d0d1e;
    box-shadow: -8px 0 30px rgba(0,0,0,0.5);
  }
}

/* Rooms select styling */
#new-room-role {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}
#new-room-role option {
  background: #0f0f20;
  color: var(--text-primary);
}

/* Profile tab button */
.profile-tab-btn:hover {
  background: rgba(255,255,255,0.04) !important;
}

/* ── COINS, GEMS & 3D GIFT SYSTEM CSS ── */

.my-coins-gems-chip:hover {
  background: rgba(255,255,255,0.1) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 10px rgba(139,92,246,0.3);
}

/* Gift Ticker Marquee */
.gift-marquee-container {
  display: flex;
  align-items: center;
  background: rgba(13, 13, 30, 0.7);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
  font-size: 12px;
  z-index: 10;
  height: 34px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.gift-marquee-title {
  color: var(--accent-gold);
  font-weight: 800;
  margin-left: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.gift-marquee-track {
  flex: 1;
  overflow: hidden;
}
.gift-marquee-track marquee {
  color: #fff;
  font-weight: bold;
}

/* Plan card hover states */
.plan-card:hover {
  border-color: var(--accent) !important;
  background: rgba(139, 92, 246, 0.08) !important;
  transform: translateY(-2px);
}
.plan-card.active {
  border-color: var(--accent2) !important;
  background: rgba(236, 72, 153, 0.12) !important;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.3) !important;
}

/* Gift selection cards */
.gift-select-card:hover {
  border-color: var(--accent) !important;
  background: rgba(255,255,255,0.08) !important;
  transform: translateY(-2px);
}
.gift-select-card.active {
  border-color: var(--accent2) !important;
  background: rgba(236, 72, 153, 0.15) !important;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.4) !important;
}

/* 3D Gift Animations Overlay */
.gift-3d-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  pointer-events: none;
  backdrop-filter: blur(4px);
  animation: fadeIn3d 0.3s ease forwards;
}
.gift-3d-overlay.hidden {
  display: none !important;
}
@keyframes fadeIn3d {
  from { opacity: 0; }
  to { opacity: 1; }
}
.gift-3d-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1000px;
}
.gift-3d-rotating-card {
  width: 180px;
  height: 180px;
  background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,69,0,0.15));
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 24px;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.4), inset 0 0 20px rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  animation: rotate3dGift 5s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  position: relative;
}
@keyframes rotate3dGift {
  0% { transform: rotateY(0deg) rotateX(15deg) scale(0.5); opacity: 0; }
  10% { transform: rotateY(360deg) rotateX(10deg) scale(1.1); opacity: 1; }
  20% { transform: rotateY(720deg) rotateX(15deg) scale(1); }
  85% { transform: rotateY(3240deg) rotateX(10deg) scale(1); opacity: 1; }
  100% { transform: rotateY(3600deg) rotateX(5deg) scale(0.5); opacity: 0; }
}
.gift-3d-icon {
  font-size: 90px;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
  transform: translateZ(30px);
  animation: bounce3dIcon 1.5s ease-in-out infinite alternate;
}
@keyframes bounce3dIcon {
  from { transform: translateZ(25px) translateY(-5px); }
  to { transform: translateZ(45px) translateY(5px); }
}
.gift-3d-shine {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.4) 40%, rgba(255,255,255,0.4) 45%, transparent 55%);
  background-size: 200% 200%;
  animation: shine3d 2s infinite linear;
  pointer-events: none;
}
@keyframes shine3d {
  0% { background-position: -200% -200%; }
  100% { background-position: 200% 200%; }
}
.gift-3d-announcement {
  margin-top: 30px;
  padding: 12px 28px;
  background: rgba(13, 13, 30, 0.85);
  border: 1px solid var(--border-glow);
  border-radius: 50px;
  box-shadow: var(--shadow-card), 0 0 20px rgba(139,92,246,0.3);
  text-align: center;
  transform: translateZ(10px);
  animation: slideInText 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
@keyframes slideInText {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.gift-3d-text {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

/* Gifter Badges */
.gifter-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 900;
  border-radius: 99px;
  margin-left: 4px;
  text-shadow: none;
  vertical-align: middle;
}
.gifter-badge.badge-gifter-1 {
  background: linear-gradient(135deg, #ff0055, #ff5500);
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 0, 85, 0.4);
}
.gifter-badge.badge-gifter-2 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
.gifter-badge.badge-gifter-3 {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  color: #0f172a;
}
.gifter-badge.badge-gifter-other {
  background: linear-gradient(135deg, #b45309, #78350f);
  color: #fff;
}

/* Floating Telegram Button */
.floating-tg-btn {
  position: fixed;
  bottom: 25px;
  left: 25px;
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #0088cc, #00a2ed);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4), 0 0 0 0px rgba(0, 136, 204, 0.5);
  z-index: 9999;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: pulseTg 2s infinite;
}
.floating-tg-btn:hover {
  transform: scale(1.15) translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 136, 204, 0.6);
}
@keyframes pulseTg {
  0% { box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4), 0 0 0 0px rgba(0, 136, 204, 0.6); }
  70% { box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4), 0 0 0 15px rgba(0, 136, 204, 0); }
  100% { box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4), 0 0 0 0px rgba(0, 136, 204, 0); }
}
.tg-tooltip {
  position: absolute;
  bottom: 65px;
  left: 0;
  background: #0f0f20;
  border: 1px solid rgba(0, 136, 204, 0.4);
  color: #fff;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.floating-tg-btn:hover .tg-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ── VIP Badges Styling ── */
.vip-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 900;
  border-radius: 4px;
  margin-left: 6px;
  margin-right: 6px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  vertical-align: middle;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.vip-lvl-1 { background: linear-gradient(135deg, #a1a1aa, #71717a); } /* Bronze/Steel */
.vip-lvl-2 { background: linear-gradient(135deg, #cbd5e1, #64748b); } /* Silver */
.vip-lvl-3 { background: linear-gradient(135deg, #fef08a, #ca8a04); color: #000; text-shadow: none; } /* Gold */
.vip-lvl-4 { background: linear-gradient(135deg, #38bdf8, #0284c7); } /* Cyan/Sky */
.vip-lvl-5 { background: linear-gradient(135deg, #a7f3d0, #059669); } /* Green Emerald */
.vip-lvl-6 { background: linear-gradient(135deg, #c084fc, #7c3aed); } /* Purple amethyst */
.vip-lvl-7 { background: linear-gradient(135deg, #fb7185, #db2777); } /* Pink Ruby */
.vip-lvl-8 { background: linear-gradient(135deg, #f97316, #ea580c); } /* Dark Orange Flame */
.vip-lvl-9 { background: linear-gradient(135deg, #f43f5e, #be123c); } /* Deep Red Ruby */
.vip-lvl-10 {
  background: linear-gradient(90deg, #ff007f, #7f00ff, #00f0ff, #ff007f);
  background-size: 300% 300%;
  animation: vip10-glow 3s linear infinite;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.7), 0 0 2px rgba(255, 255, 255, 0.5);
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes vip10-glow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ══════════════════════════════════════════════════════
   SPEECH BUBBLES - Chat Messages
══════════════════════════════════════════════════════ */

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: msgIn 0.3s ease;
  padding: 3px 0;
  max-width: 100%;
}

/* Bubble body */
.msg-body {
  max-width: 72%;
  min-width: 80px;
}

.msg-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  word-break: break-word;
  background: rgba(255,255,255,0.07);
  border-radius: 18px 18px 18px 4px;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-weight: 500;
  letter-spacing: 0.2px;
  backdrop-filter: blur(4px);
  display: inline-block;
  width: 100%;
}

/* Self messages (messages I sent) */
.msg-row.self-msg {
  flex-direction: row-reverse;
}
.msg-row.self-msg .msg-body {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
}
.msg-row.self-msg .msg-text {
  background: linear-gradient(135deg, rgba(139,92,246,0.35), rgba(236,72,153,0.25));
  border-radius: 18px 18px 4px 18px;
  border-color: rgba(139,92,246,0.3);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(139,92,246,0.2);
  text-align: right;
}
.msg-row.self-msg .msg-meta {
  flex-direction: row-reverse;
  justify-content: flex-start;
}
.msg-row.self-msg .msg-time {
  margin-right: 0;
  margin-left: auto;
}

/* owner / admin / mod message text coloring */
.msg-row[data-role="owner"] .msg-text {
  border-color: rgba(249,115,22,0.25);
  background: rgba(249,115,22,0.08);
}
.msg-row[data-role="admin"] .msg-text {
  border-color: rgba(245,158,11,0.2);
  background: rgba(245,158,11,0.06);
}
.msg-row[data-role="moderator"] .msg-text {
  border-color: rgba(16,185,129,0.2);
  background: rgba(16,185,129,0.06);
}

/* System messages */
.msg-row.system {
  justify-content: center;
}
.msg-row.system .msg-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 7px 18px;
  background: var(--system-bg);
  border-radius: 99px;
  border-right: none;
  border-color: rgba(139,92,246,0.2);
  margin: 2px 0;
  text-align: center;
  max-width: 90%;
  width: auto;
  display: inline-block;
}
.msg-row.system .msg-meta { display:none; }
.msg-row.system .msg-avatar { display:none; }

/* Font size controls */
html.size-small .msg-text, body.size-small .msg-text { font-size: 12px !important; }
html.size-normal .msg-text, body.size-normal .msg-text { font-size: 15px !important; }
html.size-large .msg-text, body.size-large .msg-text { font-size: 18px !important; }
html.size-xlarge .msg-text, body.size-xlarge .msg-text { font-size: 22px !important; }

/* ══════════════════════════════════════════════════════
   BLEEDING BLOOD RED OWNER NAME EFFECT
══════════════════════════════════════════════════════ */

.owner-blood-drip {
  position: relative;
  display: inline-block;
  color: #ff0a0a !important;
  -webkit-text-fill-color: #ff0a0a !important;
  background: none !important;
  background-clip: unset !important;
  -webkit-background-clip: unset !important;
  font-weight: 900;
  text-shadow:
    0 0 8px rgba(220,0,0,0.9),
    0 0 20px rgba(180,0,0,0.6),
    0 2px 4px rgba(0,0,0,0.8);
  animation: bloodPulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 6px #cc0000);
}

@keyframes bloodPulse {
  0%, 100% {
    text-shadow:
      0 0 8px rgba(220,0,0,0.9),
      0 0 20px rgba(180,0,0,0.6),
      0 2px 4px rgba(0,0,0,0.8);
    filter: drop-shadow(0 0 6px #cc0000);
  }
  50% {
    text-shadow:
      0 0 14px rgba(255,0,0,1),
      0 0 30px rgba(220,0,0,0.8),
      0 4px 8px rgba(0,0,0,0.9);
    filter: drop-shadow(0 0 12px #ff0000);
  }
}

/* Blood drip animation using pseudo elements */
.owner-blood-drip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(to bottom, #cc0000, #880000);
  border-radius: 0 0 50% 50%;
  animation: bloodDrip 2.5s ease-in-out infinite;
  box-shadow: 0 0 4px rgba(200,0,0,0.8);
}

@keyframes bloodDrip {
  0% { height: 0; opacity: 1; bottom: -4px; }
  40% { height: 12px; opacity: 1; bottom: -16px; }
  70% { height: 16px; opacity: 0.7; bottom: -20px; }
  100% { height: 0; opacity: 0; bottom: -24px; }
}

/* ══════════════════════════════════════════════════════
   LIGHT / DAY MODE
   ══════════════════════════════════════════════════════ */

body.light-mode {
  --bg-deep:        #f3f4f6; /* Slate 100 */
  --bg-dark:        #e5e7eb; /* Slate 200 */
  --bg-card:        #ffffff; /* White card */
  --bg-card-hover:  #f9fafb; /* Slate 50 */
  --border:         #d1d5db; /* Grey 300 */
  --border-glow:    rgba(139, 92, 246, 0.18);
  --text-primary:   #111827; /* Dark Grey 900 */
  --text-secondary: #374151; /* Dark Grey 700 */
  --text-muted:     #6b7280; /* Grey 500 */
  --system-bg:      rgba(139, 92, 246, 0.06);

  --owner-color:    #ea580c; /* Slate orange 600 */
  --admin-color:    #d97706; /* Slate gold/amber 600 */
  --mod-color:      #059669; /* Slate green 600 */

  color-scheme: light;
}

body.light-mode {
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(139,92,246,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 90%, rgba(236,72,153,0.04) 0%, transparent 60%);
}

body.light-mode::before { display: none; }

body.light-mode .chat-sidebar {
  background: rgba(255,255,255,0.75);
  border-color: var(--border);
}

body.light-mode .chat-header {
  background: rgba(255,255,255,0.85);
  border-color: var(--border);
}

body.light-mode .chat-input-area {
  background: rgba(255,255,255,0.85);
  border-color: var(--border);
}

body.light-mode .msg-input {
  background: rgba(0,0,0,0.04);
  border-color: var(--border);
  color: var(--text-primary);
}

body.light-mode .msg-text {
  background: #ffffff;
  border-color: rgba(0,0,0,0.06);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

body.light-mode .msg-row.self-msg .msg-text {
  background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(236,72,153,0.12));
  color: var(--text-primary);
  border-color: rgba(139,92,246,0.2);
}

body.light-mode .msg-row.system .msg-text {
  background: rgba(139,92,246,0.06);
  color: var(--text-secondary);
}

body.light-mode .admin-panel,
body.light-mode .modal-box,
body.light-mode .notif-dropdown,
body.light-mode .room-dropdown,
body.light-mode .font-dropdown-panel {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

body.light-mode .user-item:hover { background: rgba(0,0,0,0.04); }
body.light-mode .user-item.is-me { background: rgba(139,92,246,0.06); }
body.light-mode .toast { background: #ffffff; color: var(--text-primary); border: 1px solid var(--border); }
body.light-mode .gift-marquee-container { background: rgba(255,255,255,0.8); border-color: var(--border); }
body.light-mode .sidebar-header { background: rgba(0,0,0,0.02); }
body.light-mode .messages-container { background: transparent; }

body.light-mode .alert-error { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
body.light-mode .alert-success { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }

body.light-mode .btn-guest {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
body.light-mode .btn-guest:hover {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  color: var(--text-primary);
  border-color: var(--border);
}

body.light-mode .ttt-cell {
  background: rgba(0,0,0,0.04);
}

/* Light mode for PM page */
body.light-mode .pm-sidebar {
  background: #ffffff;
  border-color: var(--border);
}
body.light-mode .pm-conv-item:hover {
  background: rgba(0,0,0,0.03);
}
body.light-mode .pm-conv-item.active {
  background: rgba(139,92,246,0.08);
  border-color: rgba(139,92,246,0.2);
}
body.light-mode .pm-chat-header {
  background: rgba(255,255,255,0.85);
  border-color: var(--border);
}
body.light-mode .pm-msg-wrapper.other .pm-msg-bubble {
  background: #ffffff;
  border-color: var(--border);
}
body.light-mode .pm-input-panel {
  background: rgba(255,255,255,0.9);
  border-color: var(--border);
}
body.light-mode .pm-input {
  background: rgba(0,0,0,0.04);
  border-color: var(--border);
  color: var(--text-primary);
}
body.light-mode .pm-input:focus {
  background: rgba(0,0,0,0.06);
  border-color: var(--accent);
}

/* Day/Night Toggle Button */
#theme-toggle-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
  position: relative;
  color: var(--text-primary);
}
#theme-toggle-btn:hover {
  background: rgba(255,200,0,0.15);
  border-color: #f59e0b;
  transform: rotate(20deg) scale(1.1);
}
body.light-mode #theme-toggle-btn {
  background: rgba(0,0,0,0.05);
}

/* ══════════════════════════════════════════════════════
   VISITOR ENTRY TITLE BAR (animated sliding banner)
══════════════════════════════════════════════════════ */

#visitor-title-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #1a0035 0%, #2d0060 40%, #1a0035 100%);
  border-bottom: 2px solid rgba(139,92,246,0.6);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 30px rgba(139,92,246,0.4);
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
  overflow: hidden;
  pointer-events: none;
}

#visitor-title-bar.show {
  transform: translateY(0);
  pointer-events: auto;
}

#visitor-title-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: barShimmer 2s linear infinite;
}

@keyframes barShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.visitor-bar-icon {
  font-size: 22px;
  animation: waveHand 1s ease-in-out infinite;
}

@keyframes waveHand {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  75% { transform: rotate(-10deg); }
}

.visitor-bar-text {
  flex: 1;
  background: linear-gradient(90deg, #f59e0b, #ec4899, #8b5cf6, #f59e0b);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerTitle 3s linear infinite;
  font-size: 16px;
  font-weight: 900;
}

.visitor-bar-close {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: background 0.2s;
}
.visitor-bar-close:hover { background: rgba(255,0,0,0.3); }

/* ══════════════════════════════════════════════════════
   GAMES CENTER MODAL
══════════════════════════════════════════════════════ */

.games-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  overflow-x: auto;
}
.game-tab-btn {
  flex: 1;
  min-width: 100px;
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: 'Tajawal', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
}
.game-tab-btn:hover { color: var(--text-secondary); }
.game-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(139,92,246,0.08);
}

.game-panel { display: none; padding: 20px 16px; }
.game-panel.active { display: block; animation: fadeSlideIn 0.3s ease; }

/* Clash Royale style game */
.cr-arena {
  background: linear-gradient(180deg, #0a1628 0%, #162040 50%, #0d1a30 100%);
  border-radius: 14px;
  border: 1px solid rgba(100,150,255,0.2);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  min-height: 220px;
}
.cr-arena::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 50%, rgba(0,100,255,0.08) 0%, transparent 60%),
    radial-gradient(circle at 70% 50%, rgba(255,50,50,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.cr-towers-row {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  margin-bottom: 12px;
  gap: 8px;
}

.cr-tower {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s;
}
.cr-tower:hover { transform: scale(1.05); }

.cr-tower-icon {
  font-size: 42px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  transition: all 0.2s;
}
.cr-tower-icon.hit {
  animation: towerHit 0.3s ease;
}
@keyframes towerHit {
  0% { transform: scale(1); filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)) brightness(1); }
  30% { transform: scale(0.85) rotate(-5deg); filter: drop-shadow(0 4px 10px rgba(255,0,0,0.8)) brightness(2); }
  60% { transform: scale(1.1) rotate(3deg); filter: drop-shadow(0 4px 10px rgba(255,100,0,0.6)) brightness(1.5); }
  100% { transform: scale(1); filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)) brightness(1); }
}
.cr-tower-icon.destroyed {
  filter: grayscale(1) opacity(0.4) drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  transform: scale(0.8);
}

.cr-hp-bar-wrap {
  width: 70px;
  background: rgba(0,0,0,0.4);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.cr-hp-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.cr-hp-bar.ally   { background: linear-gradient(90deg, #10b981, #34d399); }
.cr-hp-bar.enemy  { background: linear-gradient(90deg, #ef4444, #f97316); }

.cr-hp-label {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
}

.cr-vs-badge {
  font-size: 22px;
  font-weight: 900;
  color: #f59e0b;
  text-shadow: 0 0 10px rgba(245,158,11,0.6);
  animation: vsPulse 1.5s ease-in-out infinite;
  align-self: center;
}
@keyframes vsPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.cr-cards-area {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cr-card {
  width: 64px;
  height: 80px;
  background: linear-gradient(135deg, #1e3a6e, #2d5299);
  border: 2px solid rgba(100,150,255,0.4);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 28px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.cr-card:hover:not(.used) {
  transform: translateY(-6px) scale(1.05);
  border-color: #f59e0b;
  box-shadow: 0 8px 20px rgba(245,158,11,0.4);
}
.cr-card.used {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.8);
}
.cr-card-name {
  font-size: 8px;
  font-weight: 800;
  color: #a5b4fc;
  margin-top: 3px;
  text-align: center;
}
.cr-elixir-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #a855f7;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 900;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cr-status-text {
  font-size: 14px;
  font-weight: 800;
  color: #f59e0b;
  margin: 8px 0;
  min-height: 22px;
}

.cr-progress-bar-wrap {
  background: rgba(0,0,0,0.3);
  border-radius: 99px;
  height: 6px;
  margin: 6px 0;
  overflow: hidden;
}
.cr-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  border-radius: 99px;
  transition: width 0.5s ease;
  width: 0%;
}

/* Pac-Man Game Canvas */
#pacman-canvas {
  border-radius: 10px;
  border: 2px solid rgba(255,200,0,0.3);
  box-shadow: 0 0 20px rgba(255,200,0,0.1);
  display: block;
  margin: 0 auto;
  background: #000;
}

.pacman-countdown-display {
  font-size: 48px;
  font-weight: 900;
  color: #f59e0b;
  text-align: center;
  text-shadow: 0 0 20px rgba(245,158,11,0.7);
  margin: 10px 0;
}

.pacman-lives {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 6px 0;
  font-size: 20px;
}

/* Game reward claim button */
.game-claim-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 12px;
  color: #000;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(245,158,11,0.4);
  display: none;
}
.game-claim-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245,158,11,0.6);
}
.game-claim-btn.show { display: block; animation: fadeSlideIn 0.4s ease; }

/* ══════════════════════════════════════════════════════
   PRIVACY POLICY / ABOUT US MODAL STYLES
══════════════════════════════════════════════════════ */

.info-modal-body {
  direction: rtl;
  text-align: right;
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 14px;
}
.info-modal-body h3 {
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  margin: 18px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-modal-body h3:first-child { margin-top: 0; }
.info-modal-body p { margin-bottom: 10px; }
.info-modal-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
.info-modal-body ul li {
  padding: 5px 0 5px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.info-modal-body ul li::before {
  content: '✦';
  color: var(--accent);
  font-size: 10px;
  margin-top: 4px;
  flex-shrink: 0;
}
.info-modal-body .highlight-box {
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
}

/* ══════════════════════════════════════════════════════
   EFFECTS CSS (canvas, screen flash, shake)
══════════════════════════════════════════════════════ */

#effects-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8000;
  opacity: 0;
  transition: opacity 0.2s;
}
#effects-canvas.active { opacity: 1; }

.screen-flash {
  position: fixed; inset: 0;
  background: rgba(255,255,200,0.35);
  pointer-events: none;
  z-index: 8999;
  animation: flashOut 0.2s ease forwards;
}
@keyframes flashOut { from{opacity:1} to{opacity:0} }

.shake-active { animation: shake 0.5s ease; }
@keyframes shake {
  0%,100%{transform:translateX(0)}
  20%{transform:translateX(-6px)}
  40%{transform:translateX(6px)}
  60%{transform:translateX(-4px)}
  80%{transform:translateX(4px)}
}

/* Entry Announcement */
.entry-announcement {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) scale(0.5);
  opacity: 0;
  z-index: 8500;
  transition: opacity 0.5s, transform 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
  pointer-events: none;
}
.entry-announcement.show {
  opacity: 1;
  transform: translate(-50%,-50%) scale(1);
}
.entry-announcement.hide {
  opacity: 0;
  transform: translate(-50%,-50%) scale(0.8);
}
.entry-box {
  padding: 28px 48px;
  border-radius: 20px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  min-width: 280px;
}
.owner-entry { background: linear-gradient(135deg,rgba(249,115,22,0.3),rgba(220,38,38,0.25)); border: 2px solid rgba(249,115,22,0.5); }
.admin-entry { background: linear-gradient(135deg,rgba(245,158,11,0.3),rgba(180,83,9,0.25)); border: 2px solid rgba(245,158,11,0.5); }
.mod-entry   { background: linear-gradient(135deg,rgba(16,185,129,0.3),rgba(5,150,105,0.25)); border: 2px solid rgba(16,185,129,0.5); }
.member-entry{ background: linear-gradient(135deg,rgba(99,102,241,0.3),rgba(67,56,202,0.2)); border: 2px solid rgba(99,102,241,0.4); }
.guest-entry { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); }
.entry-role-icon { font-size: 52px; }
.entry-username { font-size: 26px; font-weight: 900; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.entry-subtitle { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.75); }
.vip-entry-announcement { background: linear-gradient(135deg,rgba(139,92,246,0.3),rgba(236,72,153,0.2)); border: 2px solid rgba(139,92,246,0.6); }
