/* xProfile — Player Profile Popup */
.xprofile-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: xpFadeIn 0.2s ease;
}
@keyframes xpFadeIn { from { opacity: 0; } to { opacity: 1; } }

.xprofile-card {
  background: #12121e; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; width: 340px; max-width: 92vw;
  box-shadow: 0 24px 48px rgba(0,0,0,0.5), 0 0 1px rgba(0,240,255,0.2);
  animation: xpSlideUp 0.25s ease;
  font-family: 'SF Mono','Fira Code',monospace; color: #e0e0e8;
  overflow: hidden;
}
@keyframes xpSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Header area with gradient bg */
.xprofile-header {
  position: relative; padding: 24px 20px 16px;
  background: linear-gradient(135deg, rgba(0,240,255,0.06), rgba(170,102,255,0.06));
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.xprofile-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: #666; font-size: 18px;
  cursor: pointer; padding: 4px 8px; border-radius: 4px;
  transition: all 0.15s;
}
.xprofile-close:hover { color: #ff3366; background: rgba(255,51,102,0.1); }

.xprofile-identity {
  display: flex; align-items: center; gap: 14px;
}
.xprofile-avatar {
  position: relative; width: 56px; height: 56px; border-radius: 14px;
  overflow: visible; flex-shrink: 0;
}
.xprofile-avatar img {
  width: 56px; height: 56px; border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.1);
}
.xprofile-status-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2.5px solid #12121e;
}
.xprofile-status-dot.available { background: #22cc66; box-shadow: 0 0 6px rgba(34,204,102,0.5); }
.xprofile-status-dot.in-game { background: #EF9F27; box-shadow: 0 0 6px rgba(239,159,39,0.5); }
.xprofile-status-dot.unavailable { background: #444441; }
.xprofile-status-dot.offline { background: #2c2c2a; }

.xprofile-info { flex: 1; min-width: 0; }
.xprofile-name {
  font-size: 16px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 8px;
}
.xprofile-role-badge {
  font-size: 8px; padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.3px; font-weight: 800;
  flex-shrink: 0;
}
.xprofile-role-badge.admin { background: #e24b4a; color: #fff; }
.xprofile-role-badge.moderator { background: linear-gradient(135deg, #3b82f6, #60a5fa); color: #fff; }
.xprofile-role-badge.vip {
  background: linear-gradient(90deg, #ffd700, #fff8dc, #ffd700, #daa520, #ffd700);
  background-size: 400% 100%; color: #4a2800;
  animation: xpVipShimmer 2.5s linear infinite;
}
@keyframes xpVipShimmer { 0% { background-position: 0% 50%; } 100% { background-position: 400% 50%; } }

.xprofile-meta {
  margin-top: 4px; font-size: 10px; color: #666;
  display: flex; align-items: center; gap: 8px;
}
.xprofile-acct {
  font-size: 9px; padding: 1px 5px; border-radius: 3px;
  font-weight: 700; letter-spacing: 0.3px;
}
.xprofile-acct.R { border: 1px solid rgba(34,204,102,0.3); background: rgba(34,204,102,0.1); color: #22cc66; }
.xprofile-acct.Rnm { border: 1px solid rgba(239,159,39,0.3); background: rgba(239,159,39,0.1); color: #EF9F27; }
.xprofile-acct.Gp { border: 1px solid rgba(51,170,255,0.3); background: rgba(51,170,255,0.1); color: #33aaff; }
.xprofile-acct.G { border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); color: #666; }

/* Title / rank */
.xprofile-title {
  padding: 0 20px; margin-top: 0;
}
.xprofile-title-text {
  font-size: 11px; color: #aa66ff; font-style: italic;
}

/* Stats grid */
.xprofile-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1px; margin: 12px 20px; background: rgba(255,255,255,0.04);
  border-radius: 10px; overflow: hidden;
}
.xprofile-stat {
  background: #12121e; padding: 10px 8px; text-align: center;
}
.xprofile-stat-val {
  font-size: 18px; font-weight: 800; color: #00f0ff;
}
.xprofile-stat-label {
  font-size: 8px; color: #666; text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 2px;
}

/* Game breakdown */
.xprofile-games {
  margin: 0 20px 12px; border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 10px;
}
.xprofile-games-title {
  font-size: 9px; color: #666; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.xprofile-game-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 11px;
}
.xprofile-game-name { color: #e0e0e8; }
.xprofile-game-record { color: #666; }
.xprofile-game-record .w { color: #22cc66; }
.xprofile-game-record .l { color: #ff3366; }

/* Actions */
.xprofile-actions {
  display: flex; gap: 6px; padding: 12px 20px 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
  flex-wrap: wrap;
}
.xprofile-btn {
  flex: 1; min-width: 80px; padding: 8px 10px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03); color: #e0e0e8;
  font-family: inherit; font-size: 10px; cursor: pointer;
  transition: all 0.15s; text-align: center;
}
.xprofile-btn:hover {
  border-color: rgba(0,240,255,0.3); background: rgba(0,240,255,0.05);
  color: #00f0ff;
}
.xprofile-btn.primary {
  background: rgba(0,240,255,0.1); border-color: rgba(0,240,255,0.2);
  color: #00f0ff;
}
.xprofile-btn.primary:hover {
  background: rgba(0,240,255,0.18);
}
.xprofile-btn.danger {
  color: #ff3366; border-color: rgba(255,51,102,0.15);
}
.xprofile-btn.danger:hover {
  background: rgba(255,51,102,0.1); border-color: rgba(255,51,102,0.3);
}

/* Member since */
.xprofile-footer {
  padding: 0 20px 14px; font-size: 9px; color: #444;
  text-align: center;
}

/* ALM admin panel */
.xprofile-alm {
  padding: 10px 20px 14px;
  border-top: 1px solid rgba(255,51,102,0.12);
}
.xprofile-alm-label {
  font-size: 8px; color: #ff3366; text-transform: uppercase;
  letter-spacing: 1.5px; opacity: 0.4; margin-bottom: 8px;
}
.xprofile-alm-row {
  display: flex; gap: 6px; margin-bottom: 6px;
}
.xprofile-alm-row:last-child { margin-bottom: 0; }
.xprofile-alm-row .xprofile-btn {
  flex: 1; font-size: 10px; padding: 7px 6px;
}
.xprofile-alm-vip {
  color: #ffd700 !important;
  border-color: rgba(255,215,0,0.25) !important;
  background: rgba(255,215,0,0.06) !important;
}
.xprofile-alm-vip:hover {
  background: rgba(255,215,0,0.14) !important;
  border-color: rgba(255,215,0,0.4) !important;
}
.xprofile-alm-danger {
  color: #ff3366 !important;
  border-color: rgba(255,51,102,0.2) !important;
}
.xprofile-alm-danger:hover {
  background: rgba(255,51,102,0.1) !important;
  border-color: rgba(255,51,102,0.35) !important;
}
.xprofile-alm-ok {
  color: #22cc66 !important;
  border-color: rgba(34,204,102,0.2) !important;
}
.xprofile-alm-ok:hover {
  background: rgba(34,204,102,0.08) !important;
  border-color: rgba(34,204,102,0.35) !important;
}

/* ═══ Mobile profile ═══ */
@media (max-width: 600px) {
  .xprofile-card {
    width: 100% !important; max-width: 100% !important;
    min-width: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
  }
  .xprofile-overlay { align-items: flex-end !important; }
  .xprofile-close { min-height: 44px; min-width: 44px; font-size: 1.5rem; }
  .xprofile-alm-row { flex-wrap: wrap; }
  .xprofile-btn { min-height: 40px; font-size: 12px; flex: 1; min-width: 100px; }
}
