:root {
  --primary: #c117cc;
  --secondary: #7c3aed;
  --accent: #ff2e93;
  --bg: #090510;
  --surface: #140c22;
  --surface-2: #1e1233;
  --text: #f8f5ff;
  --muted: #b8a9d1;
  --border: rgba(193, 23, 204, 0.28);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
  background: radial-gradient(circle at 15% 10%, rgba(193,23,204,0.18), transparent 40%),
              radial-gradient(circle at 85% 80%, rgba(124,58,237,0.18), transparent 45%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
[dir="rtl"] body { font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* Announcement Bar */
.announcement-bar {
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12, 7, 22, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); cursor: pointer; }
.brand img { height: 42px; }
.nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 8px 14px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: 0.2s;
  font-family: inherit; font-size: 0.92rem;
}
.nav-btn:hover, .nav-btn.active {
  color: #fff; background: rgba(193, 23, 204, 0.16); border-color: var(--border);
}
.nav-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  border: none; border-radius: 12px; padding: 10px 18px; font-weight: 700; cursor: pointer;
  font-family: inherit; font-size: 0.92rem; transition: 0.22s; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; box-shadow: 0 6px 22px rgba(193, 23, 204, 0.38);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-outline {
  background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--border);
}
.btn-outline:hover { background: rgba(193,23,204,0.18); }
.btn-danger { background: rgba(239,68,68,0.18); color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: 9px; }

.wallet-pill {
  background: linear-gradient(135deg, rgba(193,23,204,0.22), rgba(124,58,237,0.22));
  border: 1px solid var(--primary);
  padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 0.9rem;
  display: flex; align-items: center; gap: 6px;
}

/* Hero */
.hero {
  padding: 54px 0 36px; text-align: center; position: relative;
}
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  background: rgba(193,23,204,0.16); border: 1px solid var(--primary);
  color: #f5d0fe; font-weight: 700; font-size: 0.85rem; margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.3rem); font-weight: 900; line-height: 1.18;
  background: linear-gradient(135deg, #ffffff 20%, #f0abfc 60%, var(--primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
}
.hero p { color: var(--muted); max-width: 720px; margin: 0 auto 26px; font-size: 1.06rem; line-height: 1.65; }

/* Cards & Grid */
.section { padding: 28px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.section-title { font-size: 1.45rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.grid-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.grid-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.grid-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 20px; transition: 0.25s; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 12px 30px rgba(193,23,204,0.2); }

.game-card-icon { font-size: 2.6rem; margin-bottom: 10px; }
.status-badge {
  position: absolute; top: 16px; inset-inline-end: 16px;
  padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
}
.status-online { background: rgba(16,185,129,0.18); color: #34d399; border: 1px solid rgba(16,185,129,0.4); }
.status-offline { background: rgba(239,68,68,0.18); color: #f87171; border: 1px solid rgba(239,68,68,0.4); }
.status-maintenance { background: rgba(245,158,11,0.18); color: #fbbf24; border: 1px solid rgba(245,158,11,0.4); }

/* Avatar + Frame Wrapper */
.avatar-wrap {
  position: relative; width: 54px; height: 54px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar-wrap.lg { width: 96px; height: 96px; }
.avatar-wrap img.avatar-img {
  width: 84%; height: 84%; border-radius: 50%; object-fit: cover; background: #1c1030; z-index: 2;
}
.avatar-wrap img.frame-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3;
}

/* =========================================================
   20-TIER LEVEL ANIMATIONS (AVATAR & USERNAME EFFECTS)
   ========================================================= */
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 8px var(--primary); } 50% { box-shadow: 0 0 22px var(--primary), 0 0 34px var(--accent); } }
@keyframes spinSlow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes shimmerText { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes floatBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes prismHue { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }

.lvl-fx-1 .avatar-img { border: 2px solid #64748b; }
.lvl-fx-2 .avatar-img { border: 2px solid #c084fc; box-shadow: 0 0 8px rgba(192,132,252,0.5); }
.lvl-fx-3 .avatar-img { border: 2px solid #c117cc; animation: pulseGlow 3s infinite; }
.lvl-fx-4 .avatar-img { border: 2px solid #e040fb; box-shadow: 0 0 14px #e040fb; }
.lvl-fx-5::before, .lvl-fx-6::before, .lvl-fx-7::before, .lvl-fx-8::before,
.lvl-fx-9::before, .lvl-fx-10::before, .lvl-fx-11::before, .lvl-fx-12::before,
.lvl-fx-13::before, .lvl-fx-14::before, .lvl-fx-15::before, .lvl-fx-16::before,
.lvl-fx-17::before, .lvl-fx-18::before, .lvl-fx-19::before, .lvl-fx-20::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%; z-index: 1;
}
.lvl-fx-5::before { border: 2px dashed #38bdf8; animation: spinSlow 10s linear infinite; }
.lvl-fx-6::before { border: 2px dashed #22d3ee; animation: spinSlow 8s linear infinite; }
.lvl-fx-7::before { border: 2px solid #34d399; box-shadow: 0 0 14px #34d399; animation: pulseGlow 2.4s infinite; }
.lvl-fx-8::before { border: 2px dotted #10b981; animation: spinSlow 6s linear infinite; }
.lvl-fx-9::before { border: 2px solid #a78bfa; box-shadow: 0 0 16px #a78bfa; }
.lvl-fx-10::before { border: 2px dashed #f472b6; animation: spinSlow 5s linear infinite; }
.lvl-fx-11::before { border: 2px solid #fb7185; box-shadow: 0 0 18px #fb7185; animation: pulseGlow 2s infinite; }
.lvl-fx-12::before { border: 3px double #fbbf24; box-shadow: 0 0 18px #fbbf24; }
.lvl-fx-13::before { border: 2px dashed #f59e0b; box-shadow: 0 0 20px #f59e0b; animation: spinSlow 4s linear infinite; }
.lvl-fx-14::before { border: 2px solid #ef4444; box-shadow: 0 0 22px #ef4444; animation: pulseGlow 1.6s infinite; }
.lvl-fx-15::before { border: 2px dashed #ec4899; box-shadow: 0 0 22px #ec4899; animation: spinSlow 3.5s linear infinite; }
.lvl-fx-16::before { border: 3px solid #8b5cf6; box-shadow: 0 0 25px #8b5cf6; animation: floatBob 2.2s ease-in-out infinite; }
.lvl-fx-17::before { border: 2px dashed #06b6d4; box-shadow: 0 0 25px #06b6d4; animation: spinSlow 3s linear infinite; }
.lvl-fx-18::before { border: 3px double #f97316; box-shadow: 0 0 28px #f97316; animation: pulseGlow 1.4s infinite; }
.lvl-fx-19::before { border: 3px dashed #e879f9; box-shadow: 0 0 30px #c117cc; animation: spinSlow 2.5s linear infinite, floatBob 2s infinite; }
.lvl-fx-20::before {
  background: conic-gradient(from 0deg, #c117cc, #00e5ff, #fbbf24, #ff2e93, #c117cc);
  animation: spinSlow 2s linear infinite, prismHue 4s linear infinite;
  box-shadow: 0 0 32px #c117cc;
}

/* Username Effects (name-fx-1 to name-fx-20) */
.player-name { font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.name-fx-1 { color: #e2e8f0; }
.name-fx-2 { color: #d8b4fe; }
.name-fx-3 { color: #f0abfc; text-shadow: 0 0 8px rgba(193,23,204,0.6); }
.name-fx-4 { background: linear-gradient(90deg, #e040fb, #7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.name-fx-5 { color: #7dd3fc; text-shadow: 0 0 10px rgba(56,189,248,0.6); }
.name-fx-6, .name-fx-7, .name-fx-8, .name-fx-9, .name-fx-10 {
  background: linear-gradient(90deg, #fff, #e879f9, #38bdf8, #fff);
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmerText 3.5s linear infinite;
}
.name-fx-11, .name-fx-12, .name-fx-13, .name-fx-14, .name-fx-15 {
  background: linear-gradient(90deg, #fde047, #fb7185, #c117cc, #fde047);
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmerText 2.5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(251,191,36,0.45));
}
.name-fx-16, .name-fx-17, .name-fx-18, .name-fx-19, .name-fx-20 {
  background: linear-gradient(90deg, #ff2e93, #00e5ff, #fde047, #c117cc, #ff2e93);
  background-size: 250% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmerText 1.8s linear infinite;
  filter: drop-shadow(0 0 10px rgba(193,23,204,0.8));
}

.frame-fx-spin { animation: spinSlow 12s linear infinite; }
.frame-fx-pulse { animation: pulseGlow 2.5s infinite; border-radius: 50%; }
.frame-fx-prism { animation: prismHue 4s linear infinite; }

/* Modals */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 2, 12, 0.82); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; z-index: 300; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: var(--surface); border: 1px solid var(--primary); border-radius: 22px;
  width: 100%; max-width: 780px; max-height: 90vh; overflow-y: auto; padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.close-btn { background: rgba(255,255,255,0.08); border: none; color: #fff; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 1.1rem; }

/* Forms & Inputs */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.form-control {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 14px; border-radius: 11px; font-family: inherit; font-size: 0.94rem;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(193,23,204,0.22); }

/* Game Table Area */
.arena-board {
  background: radial-gradient(circle at center, #22113b 0%, #0d0718 100%);
  border: 2px solid var(--primary); border-radius: 20px; padding: 20px; min-height: 320px;
}
.hand-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.domino-tile {
  background: #fff; color: #111; border-radius: 10px; padding: 8px 12px; font-weight: 900;
  font-size: 1.1rem; cursor: pointer; border: 2px solid var(--primary); min-width: 58px; text-align: center;
  transition: 0.18s;
}
.domino-tile:hover { transform: translateY(-4px); box-shadow: 0 6px 16px rgba(193,23,204,0.5); }
.uno-card {
  width: 68px; height: 98px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.15rem; color: #fff; cursor: pointer; border: 2px solid #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6); transition: 0.18s;
}
.uno-card:hover { transform: translateY(-6px); }
.uno-red { background: #dc2626; }
.uno-blue { background: #2563eb; }
.uno-green { background: #16a34a; }
.uno-yellow { background: #ca8a04; }
.uno-wild { background: linear-gradient(135deg, #c117cc, #2563eb, #16a34a, #ca8a04); }

.card-back-preview {
  width: 56px; height: 80px; border-radius: 9px; object-fit: cover; border: 2px solid var(--primary);
}

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: start; }
.data-table th { color: var(--muted); font-weight: 700; }

/* Footer */
.footer {
  margin-top: 60px; background: #07040d; border-top: 1px solid var(--border); padding: 40px 0 24px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 24px; }
.social-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.social-pill {
  padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.82rem; font-weight: 700;
}
.social-pill:hover { border-color: var(--primary); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 16px; text-align: center; color: var(--muted); font-size: 0.85rem; }

.tabs-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab-pill {
  padding: 8px 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-weight: 700; cursor: pointer; font-family: inherit;
}
.tab-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.xp-bar { width: 100%; height: 10px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.4s; }
