/* ============================================================================
REWORDS PLATFORM — style.css  (FINAL — CLEANED  & ENHANCED)
Design: Glassmorphism, neon gradients, light/dark themes, RTL support
============================================================================ */

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

:root {
  --font-en: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ar: 'Tajawal', 'Cairo', 'Poppins', sans-serif;

  --brand-1: #6a11cb;
  --brand-2: #2575fc;
  --brand-3: #00d4ff;
  --accent-1: #ff6a00;
  --accent-2: #ffb800;
  --success: #00e676;
  --success-dark: #00c853;
  --danger: #ff3d71;
  --warning: #ffc107;
  --info: #00b0ff;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;

  --shadow-1: 0 2px 8px rgba(0,0,0,.08);
  --shadow-2: 0 8px 24px rgba(0,0,0,.10);
  --shadow-3: 0 16px 48px rgba(0,0,0,.16);
  --glow-primary: 0 0 24px rgba(106,17,203,.35);
  --glow-accent: 0 0 24px rgba(255,106,0,.35);
  --glow-success: 0 0 20px rgba(0,230,118,.30);

  --ease: cubic-bezier(.25,.8,.25,1);
  --speed: .28s;

  --nav-h: 72px;
  --side-w: 268px;
  --content-max: 1400px;
}

/* ---------- 2. THEME: LIGHT ---------- */
:root, [data-theme="light"] {
  --bg: #f4f6fc;
  --bg-2: #ffffff;
  --bg-3: #eef1fa;
  --bg-glass: rgba(255,255,255,.72);
  --bg-glass-strong: rgba(255,255,255,.92);
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --border: rgba(17,24,39,.10);
  --border-strong: rgba(17,24,39,.16);
  --grad-bg: radial-gradient(1200px 800px at 10% -10%, rgba(106,17,203,.10), transparent 55%),
             radial-gradient(1000px 700px at 110% 10%, rgba(0,212,255,.12), transparent 50%),
             linear-gradient(180deg, #f4f6fc 0%, #eef1fa 100%);
  --grad-card: linear-gradient(145deg, #ffffff, #f4f6fc);
  --grad-primary: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  --grad-accent: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --grad-success: linear-gradient(135deg, #00e676, #009688);
  --grad-danger: linear-gradient(135deg, #ff3d71, #ff6b6b);
  --grad-gold: linear-gradient(135deg, #f5af19, #f12711);
  --text-on-grad: #ffffff;
  --chip-bg: rgba(17,24,39,.06);
  --table-head: #f4f6fc;
  --table-stripe: rgba(17,24,39,.02);
  --skeleton: linear-gradient(90deg, rgba(17,24,39,.06) 25%, rgba(17,24,39,.10) 37%, rgba(17,24,39,.06) 63%);
  --modal-scrim: rgba(15,18,35,.55);
}

/* ---------- 3. THEME: DARK ---------- */
[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-2: #101527;
  --bg-3: #161d36;
  --bg-glass: rgba(16,21,39,.68);
  --bg-glass-strong: rgba(16,21,39,.94);
  --text: #f1f5ff;
  --text-2: #b6c2e6;
  --text-3: #6b7699;
  --border: rgba(241,245,255,.10);
  --border-strong: rgba(241,245,255,.18);
  --grad-bg: radial-gradient(1200px 800px at 10% -10%, rgba(106,17,203,.28), transparent 55%),
             radial-gradient(1000px 700px at 110% 10%, rgba(0,212,255,.16), transparent 50%),
             radial-gradient(900px 600px at 50% 120%, rgba(255,106,0,.10), transparent 60%),
             linear-gradient(180deg, #0a0e1a 0%, #0d1122 100%);
  --grad-card: linear-gradient(160deg, #151c33, #0f1426);
  --grad-primary: linear-gradient(135deg, #7c3aed, #3b82f6);
  --grad-accent: linear-gradient(135deg, #ff8a00, #ffd000);
  --grad-success: linear-gradient(135deg, #00e676, #00c853);
  --grad-danger: linear-gradient(135deg, #ff3d71, #ff6b6b);
  --grad-gold: linear-gradient(135deg, #f5af19, #f12711);
  --text-on-grad: #ffffff;
  --chip-bg: rgba(241,245,255,.08);
  --table-head: #101527;
  --table-stripe: rgba(241,245,255,.02);
  --skeleton: linear-gradient(90deg, rgba(241,245,255,.06) 25%, rgba(241,245,255,.12) 37%, rgba(241,245,255,.06) 63%);
  --modal-scrim: rgba(3,6,16,.72);
}

/* ---------- 4. BASE ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-en);
  background: var(--grad-bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-ar); letter-spacing: 0; }
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 800; letter-spacing: -.02em; }
::selection { background: var(--brand-1); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-1), var(--brand-2));
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--accent-1), var(--accent-2)); }

:focus-visible {
  outline: 3px solid rgba(0,212,255,.5);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ---------- 5. PARTICLES  & AURORA ---------- */
.particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.particle {
  position: absolute; bottom: -12px;
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-3), transparent 70%);
  opacity: .5;
  animation: rise linear infinite;
  filter: blur(1px);
}
@keyframes rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: .55; }
  100% { transform: translateY(-110vh) translateX(30px); opacity: 0; }
}

.aurora {
  position: fixed; border-radius: 50%; filter: blur(90px);
  opacity: .22; pointer-events: none; z-index: 0;
  animation: aurora-drift 18s ease-in-out infinite alternate;
}
.aurora-1 { width: 520px; height: 520px; top: -140px; inset-inline-end: -80px; background: radial-gradient(circle, var(--brand-1), transparent 70%); }
.aurora-2 { width: 460px; height: 460px; bottom: -120px; inset-inline-start: -100px; background: radial-gradient(circle, var(--brand-3), transparent 70%); animation-delay: -6s; }
.aurora-3 { width: 400px; height: 400px; top: 40%; inset-inline-start: 55%; background: radial-gradient(circle, var(--accent-1), transparent 70%); animation-delay: -12s; }
@keyframes aurora-drift {
  0% { transform: translate(0,0) scale(1); }
  50% { transform: translate(40px,-30px) scale(1.15); }
  100% { transform: translate(-30px,20px) scale(.92); }
}

/* ---------- 6. ANIMATIONS ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes float-slow { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-20px) rotate(2deg); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: var(--glow-primary); } 50% { box-shadow: 0 0 40px rgba(0,212,255,.5); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop-in { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes slide-up { 0% { transform: translateY(40px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes slide-in-right { 0% { transform: translateX(60px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes slide-in-left { 0% { transform: translateX(-60px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes gradient-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes bounce-soft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
@keyframes conffetti-fall { 0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; } 100% { transform: translateY(110vh) rotate(720deg); opacity: 0; } }
@keyframes toastbar { from { width: 100%; } to { width: 0; } }
@keyframes bannerDrop { 0% { transform: translateX(-50%) translateY(-80px); opacity: 0; } 100% { transform: translateX(-50%) translateY(0); opacity: 1; } }
@keyframes pulseRingSoft { 0% { box-shadow: 0 0 0 0 rgba(0,230,118,.55); } 70% { box-shadow: 0 0 0 10px rgba(0,230,118,0); } 100% { box-shadow: 0 0 0 0 rgba(0,230,118,0); } }
@keyframes xpFloat { 0% { transform: translateY(0) scale(.8); opacity: 0; } 20% { opacity: 1; transform: translateY(-14px) scale(1); } 100% { transform: translateY(-90px) scale(1.1); opacity: 0; } }
@keyframes coinFly { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-160px) scale(1.6); opacity: 0; } }

/* ---------- 7. LAYOUT SHELL ---------- */
.site {
  position: relative; z-index: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 22px 80px;
}

/* Navbar */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.nav-inner {
  max-width: var(--content-max); margin: 0 auto;
  height: 100%; padding: 0 22px;
  display: flex; align-items: center; gap: 18px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: 1.35rem;
  letter-spacing: -.03em; white-space: nowrap;
}
.nav-logo .logo-badge {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  background: var(--grad-primary);
  display: grid; place-items: center;
  color: #fff; font-size: 1.25rem;
  box-shadow: var(--glow-primary);
  animation: pulse-glow 4s ease-in-out infinite;
}
.nav-links {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto; overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 8px 13px; border-radius: var(--r-full);
  font-weight: 600; font-size: .88rem;
  color: var(--text-2); white-space: nowrap;
  transition: all var(--speed) var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--chip-bg); }
.nav-link.active {
  color: #fff; background: var(--grad-primary);
  box-shadow: var(--glow-primary);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.balance-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--r-full);
  background: var(--grad-accent); color: #1a0f00;
  font-weight: 800; font-size: .92rem;
  box-shadow: var(--glow-accent); white-space: nowrap;
}
.balance-pill .coin {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffd76e, #b8860b);
  border: 2px solid rgba(255,255,255,.7);
  animation: bounce-soft 3s ease-in-out infinite;
}
html[lang="ar"] .balance-pill { flex-direction: row-reverse; }

.hamburger {
  display: none; width: 42px; height: 42px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--chip-bg);
  place-items: center;
  font-size: 1.2rem; color: var(--text);
}

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 200; display: none; }
.drawer.open { display: block; }
.drawer-scrim {
  position: absolute; inset: 0;
  background: var(--modal-scrim);
  backdrop-filter: blur(6px);
}
.drawer-panel {
  position: absolute; top: 0; bottom: 0;
  inset-inline-start: 0;
  width: min(320px, 84vw);
  background: var(--bg-2);
  border-inline-end: 1px solid var(--border);
  padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
  transform: translateX(-100%);
  transition: transform .3s var(--ease);
  overflow-y: auto;
}
html[dir="rtl"] .drawer-panel { transform: translateX(100%); }
.drawer.open .drawer-panel { transform: translateX(0); }

/* ---------- 8. PAGES  & HERO ---------- */
.page { display: none; animation: slide-up .5s var(--ease) both; }
.page.active { display: block; }

.hero {
  position: relative;
  border-radius: var(--r-xl);
  padding: clamp(32px, 6vw, 72px);
  background: var(--grad-primary);
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
  color: #fff; overflow: hidden;
  box-shadow: var(--shadow-3), var(--glow-primary);
  margin: 26px 0 30px;
}
.hero::before {
  content: ''; position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,.10);
  animation: float-slow 7s ease-in-out infinite;
}
.hero::after {
  content: ''; position: absolute;
  bottom: -80px; left: 20%;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(0,212,255,.18); filter: blur(10px);
  animation: float 9s ease-in-out infinite;
}
.hero * { position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 3.4rem);
  font-weight: 900; margin-bottom: 14px;
  text-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.hero-sub {
  font-size: clamp(.95rem, 1.6vw, 1.15rem);
  opacity: .92; max-width: 640px; margin-bottom: 26px;
}
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.badge-hero {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--r-full);
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.25);
  font-weight: 700; font-size: .82rem;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; margin-top: 26px;
}
.hero-stat {
  padding: 14px; border-radius: var(--r-md);
  background: rgba(255,255,255,.13);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.22);
}
.hero-stat .hs-value { font-size: 1.35rem; font-weight: 900; }
.hero-stat .hs-label { font-size: .76rem; opacity: .85; font-weight: 600; }

.section { margin: 34px 0; }
.section-head {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.section-title {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 800;
  display: flex; align-items: center; gap: 10px;
}
.section-title .ico {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--grad-primary); color: #fff;
  display: grid; place-items: center;
  box-shadow: var(--glow-primary); font-size: 1.05rem;
}

/* ---------- 9. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--r-full);
  border: none; font-weight: 700; font-size: .93rem;
  color: var(--text-on-grad);
  background: var(--grad-primary);
  transition: all var(--speed) var(--ease);
  box-shadow: 0 6px 20px rgba(37,99,235,.25);
  position: relative; overflow: hidden;
  white-space: nowrap; user-select: none;
  cursor: pointer;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-100%);
  transition: transform .6s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(37,99,235,.35); }
.btn:hover::after { transform: translateX(100%); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-accent { background: var(--grad-accent); color: #1a0f00; box-shadow: 0 6px 20px rgba(255,106,0,.3); }
.btn-success { background: var(--grad-success); box-shadow: 0 6px 20px rgba(0,230,118,.25); }
.btn-danger { background: var(--grad-danger); box-shadow: 0 6px 20px rgba(255,61,113,.25); }
.btn-gold { background: var(--grad-gold); color: #3d1d00; box-shadow: 0 6px 20px rgba(245,175,25,.3); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border-strong);
  box-shadow: none;
}
.btn-ghost:hover { border-color: var(--brand-2); color: var(--brand-2); transform: translateY(-2px); box-shadow: none; }
.btn-outline { background: transparent; color: var(--brand-2); border: 2px solid var(--brand-2); box-shadow: none; }
.btn-primary { background: var(--grad-primary); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-xs { padding: 5px 10px; font-size: .72rem; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; font-size: 1.05rem; }
.btn.loading { pointer-events: none; opacity: .8; }
.btn .ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.45);
  transform: scale(0); animation: ripple .6s var(--ease);
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- 10. CARDS ---------- */
.card {
  position: relative;
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-1);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: var(--border-strong);
}
.card-hover-glow:hover {
  border-color: rgba(106,17,203,.5);
  box-shadow: var(--glow-primary), var(--shadow-2);
}
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.card-grad { border: none; }
.card-grad:hover { transform: translateY(-5px) scale(1.01); }
.card .card-head {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card .card-title { font-size: 1.02rem; font-weight: 800; }
.card .card-sub { font-size: .82rem; color: var(--text-3); }

.grad-a { background: var(--grad-primary); color: #fff; }
.grad-b { background: var(--grad-accent); color: #2a1600; }
.grad-c { background: var(--grad-success); color: #062; }
.grad-d { background: var(--grad-danger); color: #fff; }
.grad-e { background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; }
.grad-f { background: linear-gradient(135deg,#f83600,#f9d423); color: #fff; }
.grad-g { background: linear-gradient(135deg,#11998e,#38ef7d); color: #fff; }
.grad-h { background: linear-gradient(135deg,#fc466b,#3f5efb); color: #fff; }

/* Stat cards */
.stat-card { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-card .stat-ico {
  width: 44px; height: 44px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 1.3rem; margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 900; letter-spacing: -.02em;
}
.stat-card .stat-label { font-size: .82rem; color: var(--text-3); font-weight: 600; }

/* ---------- 11. GRIDS ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-6 { grid-column: span 6; }
.col-span-12 { grid-column: span 12; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }

/* ---------- 12. BADGES / CHIPS ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: var(--r-full);
  font-size: .74rem; font-weight: 800;
  letter-spacing: .02em; text-transform: uppercase;
}
.badge-success { background: rgba(0,230,118,.15); color: var(--success); border: 1px solid rgba(0,230,118,.35); }
.badge-danger { background: rgba(255,61,113,.15); color: var(--danger); border: 1px solid rgba(255,61,113,.35); }
.badge-warning { background: rgba(255,193,7,.15); color: var(--warning); border: 1px solid rgba(255,193,7,.35); }
.badge-info { background: rgba(0,176,255,.15); color: var(--info); border: 1px solid rgba(0,176,255,.35); }
.badge-primary { background: rgba(106,17,203,.15); color: var(--brand-1); border: 1px solid rgba(106,17,203,.35); }
.badge-neutral { background: var(--chip-bg); color: var(--text-2); border: 1px solid var(--border); }
.badge-grad { background: var(--grad-primary); color: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-full);
  background: var(--chip-bg);
  border: 1px solid var(--border);
  font-size: .82rem; font-weight: 600;
  color: var(--text-2);
  transition: all var(--speed) var(--ease);
  cursor: pointer;
}
.chip:hover { border-color: var(--brand-2); color: var(--brand-2); }
.chip.active { background: var(--grad-primary); color: #fff; border-color: transparent; }

/* ---------- 13. FORMS ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label {
  font-size: .82rem; font-weight: 700;
  color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--text);
  font-size: .95rem;
  transition: all var(--speed) var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(37,99,235,.15);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:disabled, .select:disabled { opacity: .6; cursor: not-allowed; }
.textarea { min-height: 110px; resize: vertical; }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
html[dir="rtl"] .select {
  background-position: calc(0% + 20px) 55%, calc(0% + 15px) 55%;
  padding-left: 36px; padding-right: 16px;
}
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-start: 42px; }
.input-wrap > .i-ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-wrap .i-toggle { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-3); font-size: .9rem; cursor: pointer; }

/* Checkbox */
.cbx { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .86rem; }
.cbx input { display: none; }
.cbx .cbx-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border-strong); display: grid; place-items: center; color: transparent; font-size: .72rem; transition: all var(--speed) var(--ease); flex-shrink: 0; }
.cbx input:checked + .cbx-box { background: var(--grad-success); border-color: transparent; color: #fff; transform: scale(1.05); }

.strength-meter { display: flex; gap: 5px; margin-top: 8px; }
.strength-meter span { flex: 1; height: 5px; border-radius: 99px; background: var(--chip-bg); transition: all .3s; }
.strength-meter.weak span:nth-child(-n+1) { background: var(--danger); }
.strength-meter.medium span:nth-child(-n+2) { background: var(--warning); }
.strength-meter.strong span:nth-child(-n+3) { background: var(--success); }
.strength-meter.very-strong span { background: var(--success); }

/* ---------- 14. TABLES ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-2);
  box-shadow: var(--shadow-1);
}
.table { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 640px; }
.table thead th {
  background: var(--table-head);
  color: var(--text-2);
  text-align: start;
  padding: 13px 16px;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--speed) var(--ease); }
.table tbody tr:nth-child(even) { background: var(--table-stripe); }
.table tbody tr:hover { background: rgba(37,99,235,.06); }
.table tbody td { padding: 13px 16px; vertical-align: middle; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- 15. MODALS ---------- */
.modal-scrim {
  position: fixed; inset: 0; z-index: 300;
  background: var(--modal-scrim);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-scrim.open { display: flex; }
.modal {
  width: 100%; max-width: 540px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-3);
  animation: pop-in .35s var(--ease) both;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1060px; }
.modal-sm { max-width: 400px; }
.modal-head {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 14px; margin-bottom: 20px;
}
.modal-title { font-size: 1.2rem; font-weight: 800; }
.modal-close {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text-2); font-size: 1rem;
  display: grid; place-items: center;
  transition: all var(--speed) var(--ease);
  cursor: pointer;
}
.modal-close:hover { background: var(--grad-danger); color: #fff; transform: rotate(90deg); }

/* ---------- 16. TOASTS ---------- */
.toast-wrap {
  position: fixed;
  top: calc(var(--nav-h) + 14px);
  inset-inline-end: 18px;
  z-index: 400;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 380px;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  animation: slide-in-right .4s var(--ease) both;
  position: relative; overflow: hidden;
}
html[dir="rtl"] .toast { animation-name: slide-in-left; }
.toast.hide { animation: slide-up .3s var(--ease) reverse both; }
.toast .toast-ico { font-size: 1.2rem; flex-shrink: 0; }
.toast .toast-body { flex: 1; }
.toast .toast-title { font-weight: 800; font-size: .9rem; margin-bottom: 2px; }
.toast .toast-msg { font-size: .82rem; color: var(--text-2); }
.toast.success { border-color: rgba(0,230,118,.5); }
.toast.error { border-color: rgba(255,61,113,.5); }
.toast.warning { border-color: rgba(255,193,7,.5); }
.toast.info { border-color: rgba(0,176,255,.5); }
.toast-progress {
  position: absolute; bottom: 0; inset-inline-start: 0;
  height: 3px;
  background: var(--grad-primary);
  animation: toastbar 4s linear forwards;
}

/* ---------- 17. SKELETON ---------- */
.skeleton-line {
  height: 14px; margin-bottom: 10px;
  border-radius: var(--r-sm);
  background: var(--skeleton);
  background-size: 200% 100%;
  animation: shimmer-bg 1.4s infinite;
}
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-40 { width: 40%; }

/* ---------- 18. AVATARS ---------- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad-primary); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1rem;
  flex-shrink: 0; box-shadow: var(--shadow-1);
  position: relative;
}
.avatar-lg { width: 88px; height: 88px; font-size: 2rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar-xl { width: 120px; height: 120px; font-size: 2.6rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ---------- 19. OFFER / REWARD / GAME CARDS ---------- */
.offer-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px; cursor: pointer;
}
.offer-card .offer-top { display: flex; align-items: center; gap: 12px; }
.offer-card .offer-logo {
  width: 52px; height: 52px; border-radius: var(--r-md);
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 1.5rem; color: #fff;
  box-shadow: var(--shadow-1); flex-shrink: 0;
  overflow: hidden;
}
.offer-card .offer-name { font-weight: 800; font-size: .96rem; line-height: 1.3; }
.offer-card .offer-reward {
  display: flex; align-items: center; gap: 8px;
  font-weight: 900; font-size: 1.15rem;
  background: linear-gradient(135deg, #ffd76e, #ffb800);
  -webkit-background-clip: text;
  background-clip: text; color: transparent;
}

.game-card { position: relative; overflow: hidden; cursor: pointer; }
.game-card .game-cover {
  height: 130px; border-radius: var(--r-md);
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 2.6rem; margin-bottom: 12px;
  position: relative;
}
.game-card .game-milestones { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }

.milestone {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--chip-bg);
  border: 1px solid var(--border);
  transition: all var(--speed) var(--ease);
}
.milestone.done { border-color: rgba(0,230,118,.4); background: rgba(0,230,118,.08); }
.milestone .ms-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; background: var(--chip-bg); flex-shrink: 0; }
.milestone.done .ms-ico { background: var(--grad-success); color: #fff; }
.milestone .ms-body { flex: 1; }
.milestone .ms-title { font-size: .82rem; font-weight: 700; }
.milestone .ms-sub { font-size: .72rem; color: var(--text-3); }
.milestone .ms-reward { font-weight: 800; font-size: .82rem; color: var(--warning); white-space: nowrap; }

.reward-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--chip-bg);
  transition: all var(--speed) var(--ease);
  cursor: pointer;
}
.reward-item:hover { border-color: var(--brand-2); transform: translateX(4px); }
.reward-item.selected { border-color: var(--brand-2); background: rgba(37,99,235,.08); box-shadow: var(--glow-primary); }
.reward-item .rw-ico { width: 48px; height: 48px; border-radius: var(--r-sm); background: var(--grad-primary); display: grid; place-items: center; font-size: 1.4rem; color: #fff; flex-shrink: 0; }
.reward-item .rw-body { flex: 1; min-width: 0; }
.reward-item .rw-name { font-weight: 800; font-size: .92rem; }
.reward-item .rw-sub { font-size: .76rem; color: var(--text-3); }

.reward-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; text-align: center; }
.reward-card .rw-logo {
  width: 56px; height: 56px; border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 1.6rem; color: #fff;
  margin: 0 auto;
  box-shadow: var(--shadow-1);
}
.reward-card .rw-name { font-weight: 800; font-size: .92rem; }
.reward-card .rw-sub { font-size: .76rem; color: var(--text-3); }
.reward-card .rw-from { font-size: .82rem; font-weight: 700; }

/* ---------- 20. TABS ---------- */
.tabs {
  display: flex; gap: 6px; padding: 6px;
  background: var(--chip-bg);
  border-radius: var(--r-full);
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--border);
  max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 18px;
  border-radius: var(--r-full);
  font-weight: 700; font-size: .84rem;
  color: var(--text-2);
  white-space: nowrap;
  transition: all var(--speed) var(--ease);
  border: none; background: transparent;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--grad-primary); color: #fff; box-shadow: var(--glow-primary); }

/* ---------- 21. DAILY / WHEEL / SCRATCH ---------- */
.daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
}
.day-cell {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  padding: 16px 8px;
  border-radius: var(--r-lg);
  background: var(--chip-bg);
  border: 1.5px solid var(--border);
  transition: all var(--speed) var(--ease);
}
.day-cell .day-num {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: .9rem;
  background: var(--chip-bg);
}
.day-cell .day-reward { font-weight: 800; font-size: .86rem; color: var(--warning); }
.day-cell .day-label { font-size: .72rem; color: var(--text-3); font-weight: 700; text-transform: uppercase; }
.day-cell.done { border-color: rgba(0,230,118,.5); background: rgba(0,230,118,.08); }
.day-cell.done .day-num { background: var(--grad-success); color: #fff; }
.day-cell.today { border-color: var(--brand-2); box-shadow: var(--glow-primary); animation: pulse-glow 3s ease-in-out infinite; }
.day-cell.today .day-num { background: var(--grad-primary); color: #fff; }
.day-cell .day-check { position: absolute; top: 6px; inset-inline-end: 8px; font-size: .75rem; color: var(--success); }

.wheel-wrap { position: relative; width: min(360px, 86vw); aspect-ratio: 1; margin: 0 auto; }
.wheel {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 10px solid var(--bg-2);
  box-shadow: var(--shadow-3), 0 0 0 4px var(--border);
  position: relative; overflow: hidden;
  transition: transform 4s cubic-bezier(.12,.7,.05,1);
  background: conic-gradient(
    #ff6a00 0deg 45deg, #6a11cb 45deg 90deg,
    #00e676 90deg 135deg, #ff3d71 135deg 180deg,
    #667eea 180deg 225deg, #f5af19 225deg 270deg,
    #11998e 270deg 315deg, #fc466b 315deg 360deg
  );
}
.wheel-pointer {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 34px solid var(--danger);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.3));
  z-index: 5;
}

.scratch {
  position: relative;
  width: min(340px, 90vw); height: 200px;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  user-select: none;
  margin: 0 auto;
}
.scratch .scratch-cover {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, #7c3aed, #7c3aed 12px, #9f5cf0 12px, #9f5cf0 24px);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: .9rem;
  z-index: 2;
  cursor: pointer;
}
.scratch .scratch-result {
  position: absolute; inset: 0;
  background: var(--grad-accent);
  display: grid; place-items: center;
  color: #3d1d00;
  font-weight: 900; font-size: 1.3rem;
  z-index: 1;
}

.mystery-box {
  width: 160px; height: 160px;
  margin: 0 auto;
  border-radius: var(--r-lg);
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 3.4rem;
  cursor: pointer;
  box-shadow: var(--glow-primary);
  animation: bounce-soft 2.6s ease-in-out infinite;
  transition: transform var(--speed) var(--ease);
}
.mystery-box:hover { transform: scale(1.06) rotate(-3deg); }
.mystery-box.opened { background: var(--grad-success); animation: none; }
.mystery-box.shaking { animation: wiggle .4s ease-in-out infinite; }

.treasure {
  width: 140px; height: 130px;
  margin: 0 auto;
  border-radius: var(--r-lg) var(--r-lg) 50% 50% / var(--r-lg) var(--r-lg) 40% 40%;
  background: linear-gradient(180deg, #ffd76e, #d99600);
  display: grid; place-items: center;
  font-size: 3rem;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(217,150,0,.4);
  animation: float 4s ease-in-out infinite;
}
.treasure.opened { background: var(--grad-success); animation: none; }
.treasure.shaking { animation: wiggle .4s ease-in-out infinite; }

/* ---------- 22. TOP-UP / WITHDRAW ---------- */
.package-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.package {
  padding: 14px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--chip-bg);
  text-align: center;
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}
.package:hover { border-color: var(--brand-2); transform: translateY(-3px); }
.package.selected { border-color: var(--brand-2); background: rgba(37,99,235,.1); box-shadow: var(--glow-primary); }
.package .pkg-name { font-weight: 800; font-size: .95rem; }
.package .pkg-cost { font-size: .78rem; color: var(--text-3); font-weight: 600; }
.package .pkg-save { font-size: .7rem; font-weight: 800; color: var(--success); }

.wd-method {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--chip-bg);
  cursor: pointer;
  transition: all var(--speed) var(--ease);
  text-align: center;
}
.wd-method:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.wd-method.selected { border-color: var(--brand-2); background: rgba(37,99,235,.08); box-shadow: var(--glow-primary); }
.wd-method .wm-ico { font-size: 1.8rem; }
.wd-method .wm-name { font-weight: 800; font-size: .92rem; }
.wd-method .wm-min { font-size: .72rem; color: var(--text-3); font-weight: 600; }

/* ---------- 23. LEADERBOARD ---------- */
.leader-item, .lb-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  transition: all var(--speed) var(--ease);
}
.leader-item:hover, .lb-row:hover { background: var(--chip-bg); }
.leader-item .rank, .lb-rank {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 900;
  background: var(--chip-bg);
  flex-shrink: 0;
}
.leader-item .rank.r1, .lb-rank.top:first-child { background: linear-gradient(135deg,#ffd700,#ffb800); color: #3d1d00; box-shadow: 0 0 18px rgba(255,215,0,.5); }
.lb-ava {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad-primary); color: #fff;
  display: grid; place-items: center;
  font-weight: 800;
  overflow: hidden;
}
.lb-ava img { width: 100%; height: 100%; object-fit: cover; }
.lb-body { flex: 1; min-width: 0; }
.lb-name { font-weight: 800; font-size: .9rem; }
.lb-sub { font-size: .76rem; color: var(--text-3); }
.lb-xp { font-weight: 900; color: var(--warning); font-variant-numeric: tabular-nums; }
.lb-row.me { border: 1.5px solid var(--brand-2); background: rgba(37,99,235,.08); }

/* ---------- 24. REFERRAL ---------- */
.ref-link-box {
  display: flex; gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--brand-2);
  background: rgba(37,99,235,.06);
}
.ref-link-box .ref-link { flex: 1; border: none; background: transparent; color: var(--text); font-size: .9rem; font-weight: 700; }

/* ---------- 25. WALLET / LEDGER ---------- */
.ledger-item { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.ledger-item:last-child { border-bottom: none; }
.ledger-item .lg-ico { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 1.05rem; flex-shrink: 0; }
.ledger-item .lg-body { flex: 1; min-width: 0; }
.ledger-item .lg-title { font-weight: 700; font-size: .9rem; }
.ledger-item .lg-sub { font-size: .76rem; color: var(--text-3); }
.ledger-item .lg-amount { font-weight: 900; font-size: .98rem; white-space: nowrap; }
.lg-plus { color: var(--success); }
.lg-minus { color: var(--danger); }

/* ---------- 26. AUTH MODAL ---------- */
.auth-tabs { display: flex; gap: 6px; background: var(--chip-bg); padding: 5px; border-radius: var(--r-full); margin-bottom: 22px; }
.auth-tabs button { flex: 1; padding: 10px; border: none; background: transparent; border-radius: var(--r-full); font-weight: 800; color: var(--text-2); transition: all var(--speed) var(--ease); cursor: pointer; }
.auth-tabs button.active { background: var(--grad-primary); color: #fff; box-shadow: var(--glow-primary); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 22px; text-align: center; }
.auth-logo .big-badge { width: 64px; height: 64px; border-radius: var(--r-lg); background: var(--grad-primary); display: grid; place-items: center; font-size: 1.8rem; color: #fff; box-shadow: var(--glow-primary); animation: pulse-glow 4s ease-in-out infinite; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px; border-radius: var(--r-md); border: 1.5px solid var(--border-strong); background: var(--bg-2); color: var(--text); font-weight: 700; font-size: .9rem; transition: all var(--speed) var(--ease); cursor: pointer; }
.social-btn:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-3); font-size: .8rem; font-weight: 700; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }

/* ---------- 27. PROFILE ---------- */
.profile-cover {
  height: 170px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--grad-primary);
  background-size: 200% 200%;
  animation: gradient-shift 10s ease infinite;
}
.profile-head {
  display: flex; align-items: flex-end;
  gap: 18px; padding: 0 24px;
  margin-top: -48px; flex-wrap: wrap;
}
.profile-head .avatar { border: 4px solid var(--bg-2); }
.profile-meta { flex: 1; min-width: 200px; }
.xp-wrap { width: 100%; margin-top: 6px; }
.xp-top { display: flex; justify-content: space-between; font-size: .76rem; font-weight: 700; color: var(--text-3); margin-bottom: 4px; }
.xp-track { height: 12px; border-radius: 99px; background: var(--chip-bg); overflow: hidden; }
.xp-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-1), var(--brand-3)); transition: width .8s var(--ease); position: relative; overflow: hidden; }
.xp-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent); transform: translateX(-100%); animation: shimmer 2.4s infinite; }
.level-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--r-full); background: var(--grad-primary); color: #fff; font-weight: 900; font-size: .82rem; box-shadow: var(--glow-primary); }

.ach-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--chip-bg); border: 1px solid var(--border); margin-bottom: 8px; }
.ach-item.locked { opacity: .55; filter: grayscale(.8); }
.ach-item.done { border-color: rgba(0,230,118,.4); }
.ach-item .ach-ico { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--grad-primary); display: grid; place-items: center; font-size: 1.2rem; color: #fff; flex-shrink: 0; }

.device-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-2); margin-bottom: 8px; }
.device-card.current { border-color: rgba(0,230,118,.4); }
.device-card .dc-ico { width: 46px; height: 46px; border-radius: var(--r-sm); background: var(--chip-bg); display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.device-card .dc-body { flex: 1; min-width: 0; }
.device-card .dc-name { font-weight: 800; font-size: .9rem; }
.device-card .dc-sub { font-size: .76rem; color: var(--text-3); }
.device-card .dc-time { font-size: .72rem; color: var(--text-3); font-variant-numeric: tabular-nums; }

.avatar-upload { position: relative; width: 120px; height: 120px; border-radius: 50%; overflow: hidden; cursor: pointer; display: inline-block; }
.avatar-upload .au-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload .au-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: 1.4rem; opacity: 0; transition: opacity var(--speed); }
.avatar-upload:hover .au-overlay { opacity: 1; }

/* ---------- 28. NOTIFICATIONS ---------- */
.notif-item {
  display: flex; gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-2);
  cursor: pointer;
  transition: all var(--speed) var(--ease);
  margin-bottom: 8px;
}
.notif-item:hover { border-color: var(--brand-2); transform: translateX(4px); }
.notif-item.unread { background: rgba(37,99,235,.07); border-color: rgba(37,99,235,.3); }
.notif-item .nt-ico { width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--chip-bg); display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; }
.notif-item.unread .nt-ico { background: var(--grad-primary); color: #fff; }
.notif-item .nt-body { flex: 1; }
.notif-item .nt-title { font-weight: 800; font-size: .9rem; }
.notif-item .nt-sub { font-size: .82rem; color: var(--text-2); }
.notif-item .nt-time { font-size: .72rem; color: var(--text-3); }
.nt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); align-self: flex-start; margin-top: 8px; }

/* ---------- 29. SUPPORT / TICKETS ---------- */
.ticket-item { display: flex; gap: 14px; padding: 16px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-2); transition: all var(--speed) var(--ease); cursor: pointer; margin-bottom: 8px; }
.ticket-item:hover { border-color: var(--brand-2); transform: translateY(-3px); box-shadow: var(--shadow-1); }
.chat-box { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 8px; background: var(--bg-3); border-radius: var(--r-md); }
.msg { max-width: 78%; padding: 11px 15px; border-radius: var(--r-md); font-size: .88rem; position: relative; animation: pop-in .3s var(--ease) both; }
.msg.user, .chat-msg.me { align-self: flex-end; background: var(--grad-primary); color: #fff; border-end-end-radius: 4px; }
.msg.admin, .msg.system, .chat-msg.bot { align-self: flex-start; background: var(--chip-bg); border-start-start-radius: 4px; }
.msg .msg-time, .cm-time { display: block; font-size: .66rem; opacity: .65; margin-top: 5px; }

/* ---------- 30. FAQ ---------- */
.faq-item { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-2); overflow: hidden; margin-bottom: 12px; transition: border-color var(--speed) var(--ease); }
.faq-item.open { border-color: var(--brand-2); box-shadow: var(--shadow-1); }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; background: none; border: none; font-weight: 800; font-size: .94rem; color: var(--text); text-align: start; cursor: pointer; }
.faq-q .faq-chev, .faq-q .faq-ico { font-size: 1.2rem; transition: transform .3s var(--ease); color: var(--brand-2); flex-shrink: 0; }
.faq-item.open .faq-ico, .faq-item.open .faq-chev { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); }
.faq-item.open .faq-a { max-height: 600px; }
.faq-a-inner { padding: 0 18px 18px; font-size: .87rem; color: var(--text-2); }

/* ---------- 31. ADS ---------- */
.ad-box { display: flex; align-items: center; justify-content: center; border-radius: var(--r-lg); border: 1.5px dashed var(--border-strong); background: var(--chip-bg); min-height: 120px; margin: 18px 0; position: relative; overflow: hidden; }
.ad-box .ad-label { position: absolute; top: 6px; inset-inline-start: 10px; font-size: .62rem; font-weight: 800; letter-spacing: .12em; color: var(--text-3); text-transform: uppercase; }
.ad-box-468 { min-height: 60px; }
.ad-box-native { min-height: 90px; }

.ad-rew { position: relative; text-align: center; padding: 30px 20px; cursor: pointer; overflow: hidden; }
.ad-rew .play-ring {
  width: 92px; height: 92px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 2.2rem; color: #fff;
  box-shadow: var(--glow-primary);
  animation: pulse-glow 3s ease-in-out infinite;
  transition: transform var(--speed) var(--ease);
}
.ad-rew:hover .play-ring { transform: scale(1.1); }

.ad-watch-card { position: relative; text-align: center; padding: 34px 22px; overflow: hidden; }
.ad-watch-card .adw-bg { position: absolute; inset: -30px; background: radial-gradient(circle at 50% 0%, rgba(0,212,255,.22), transparent 60%); filter: blur(16px); pointer-events: none; }

.ad-countdown-ring { width: 140px; height: 140px; margin: 0 auto 18px; position: relative; display: grid; place-items: center; }
.ad-countdown-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ad-countdown-ring .acr-track { fill: none; stroke: var(--chip-bg); stroke-width: 10; }
.ad-countdown-ring .acr-bar { fill: none; stroke: var(--brand-2); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.ad-countdown-ring .acr-value { position: absolute; font-weight: 900; font-size: 2rem; font-variant-numeric: tabular-nums; }

/* ---------- 32. EMPTY STATE ---------- */
.empty, .empty-state { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty .empty-ico, .empty-state .es-ico { font-size: 3.2rem; opacity: .5; animation: float 4s ease-in-out infinite; }
.empty .empty-title, .empty-state .es-title { font-weight: 800; color: var(--text-2); font-size: 1.05rem; }
.empty .empty-sub, .empty-state .es-sub { font-size: .86rem; max-width: 380px; }

/* ---------- 33. SECURITY / STATUS ---------- */
.risk-meter { height: 12px; border-radius: 99px; background: var(--chip-bg); overflow: hidden; }
.risk-meter .risk-fill { height: 100%; border-radius: 99px; transition: width .8s var(--ease); }
.risk-fill.low { background: linear-gradient(90deg, #00e676, #38ef7d); }
.risk-fill.med { background: linear-gradient(90deg, #ffc107, #ff8a00); }
.risk-fill.high { background: linear-gradient(90deg, #ff3d71, #ff6b6b); }

.status-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); margin-bottom: 8px; }
.status-row .sr-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; flex-shrink: 0; }
.status-row.pass { border-color: rgba(0,230,118,.35); }
.status-row.pass .sr-ico { background: rgba(0,230,118,.15); color: var(--success); }
.status-row.warn { border-color: rgba(255,193,7,.35); }
.status-row.warn .sr-ico { background: rgba(255,193,7,.15); color: var(--warning); }
.status-row.fail { border-color: rgba(255,61,113,.35); }
.status-row.fail .sr-ico { background: rgba(255,61,113,.15); color: var(--danger); }
.status-row .sr-body { flex: 1; }
.status-row .sr-title { font-weight: 700; font-size: .88rem; }
.status-row .sr-sub { font-size: .76rem; color: var(--text-3); }

.sec-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-2); transition: all var(--speed); }
.sec-card:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.sec-card .sc-ico { width: 46px; height: 46px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.sec-card .sc-ico.on { background: rgba(0,230,118,.14); color: var(--success); }
.sec-card .sc-ico.off { background: rgba(255,61,113,.14); color: var(--danger); }
.sec-card .sc-body { flex: 1; }
.sec-card .sc-title { font-weight: 800; font-size: .9rem; }
.sec-card .sc-sub { font-size: .76rem; color: var(--text-3); }

/* ---------- 34. FOOTER ---------- */
.footer { margin-top: 60px; padding-top: 34px; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 28px; }
.footer h5 { font-size: .86rem; font-weight: 800; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .05em; }
.footer a { display: block; font-size: .84rem; color: var(--text-2); padding: 5px 0; transition: color var(--speed) var(--ease); }
.footer a:hover { color: var(--brand-2); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-3); flex-wrap: wrap; }

/* ---------- 35. TOOLBAR / SEARCH / FILTERS ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box .input { padding-inline-start: 42px; }
.search-box .s-ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-box .s-clear { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-3); font-size: .9rem; cursor: pointer; }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  padding: 7px 14px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  font-weight: 700; font-size: .8rem;
  transition: all var(--speed) var(--ease);
  cursor: pointer;
}
.filter-chip:hover { border-color: var(--brand-2); color: var(--brand-2); }
.filter-chip.active { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: var(--glow-primary); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination .page-btn { min-width: 38px; height: 38px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--bg-2); color: var(--text-2); font-weight: 700; transition: all var(--speed) var(--ease); cursor: pointer; }
.pagination .page-btn:hover { border-color: var(--brand-2); color: var(--brand-2); }
.pagination .page-btn.active { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: var(--glow-primary); }
.pagination .page-btn:disabled { opacity: .4; pointer-events: none; }

/* ---------- 36. TICKER ---------- */
.ticker { overflow: hidden; white-space: nowrap; border-radius: var(--r-full); background: var(--chip-bg); border: 1px solid var(--border); padding: 10px 0; position: relative; }
.ticker .ticker-track { display: inline-block; animation: ticker 26s linear infinite; padding-inline-start: 100%; }
.ticker .ticker-item { display: inline-flex; align-items: center; gap: 8px; padding: 0 24px; font-weight: 700; font-size: .84rem; color: var(--text-2); }
.ticker .ticker-item .coin-t, .coin-t { color: var(--warning); font-weight: 900; }

/* ---------- 37. CONFETTI  & REWARD POPUP ---------- */
.confetti { position: fixed; top: 0; left: 0; width: 12px; height: 12px; z-index: 500; pointer-events: none; animation: conffetti-fall 3.5s ease-in forwards; }

.reward-popup { text-align: center; }
.reward-popup .rp-amount { font-size: 3.4rem; font-weight: 900; background: linear-gradient(135deg, #ffd76e, #ffb800, #ff6a00); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; margin: 10px 0; }
.reward-popup .rp-emoji { font-size: 4.5rem; display: block; margin-bottom: 8px; animation: bounce-soft 1.6s ease-in-out infinite; }

.unlock-banner { position: fixed; top: calc(var(--nav-h) + 14px); inset-inline-start: 50%; transform: translateX(-50%) translateY(-80px); z-index: 700; display: none; align-items: center; gap: 14px; padding: 14px 22px; border-radius: var(--r-lg); background: var(--grad-primary); color: #fff; box-shadow: var(--shadow-3), var(--glow-primary); }
html[dir="rtl"] .unlock-banner { transform: translateX(50%) translateY(-80px); }
.unlock-banner.show { display: flex; animation: bannerDrop .5s var(--ease) forwards; }
.unlock-banner .ub-ico { font-size: 2rem; animation: bounce-soft 1.4s ease-in-out infinite; }
.unlock-banner .ub-title { font-weight: 900; font-size: 1rem; }
.unlock-banner .ub-sub { font-size: .78rem; opacity: .9; }

/* ---------- 38. UTILITIES ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: end; }
.text-left { text-align: start; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; } .mt-5 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 26px; } .mb-5 { margin-bottom: 40px; }
.py-3 { padding-top: 18px; padding-bottom: 18px; } .py-4 { padding-top: 26px; padding-bottom: 26px; }
.p-0 { padding: 0; } .p-1 { padding: 6px; } .p-2 { padding: 12px; } .p-3 { padding: 18px; } .p-4 { padding: 26px; }
.gap-1 { gap: 6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 18px; }
.flex { display: flex; } .flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.flex-1 { flex: 1; } .wrap { flex-wrap: wrap; }
.ml-auto { margin-inline-start: auto; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.text-info { color: var(--info); } .text-primary { color: var(--brand-2); } .text-muted { color: var(--text-3); }
.font-bold { font-weight: 800; } .font-black { font-weight: 900; }
.text-xs { font-size: .72rem; } .text-sm { font-size: .82rem; } .text-md { font-size: .94rem; } .text-lg { font-size: 1.15rem; } .text-xl { font-size: 1.45rem; } .text-2xl { font-size: 1.9rem; }
.rounded { border-radius: var(--r-md); } .rounded-lg { border-radius: var(--r-lg); } .rounded-full { border-radius: var(--r-full); }
.glow-primary { box-shadow: var(--glow-primary); } .glow-accent { box-shadow: var(--glow-accent); } .glow-success { box-shadow: var(--glow-success); }
.sticky-top { position: sticky; top: calc(var(--nav-h) + 14px); z-index: 20; }
.divider-h { height: 1px; background: var(--border); margin: 18px 0; }
.relative { position: relative; } .absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.mx-auto { margin-inline: auto; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.cursor-pointer { cursor: pointer; }
.grad-text { background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }

.to-top {
  position: fixed;
  bottom: 22px; inset-inline-end: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff; border: none;
  box-shadow: var(--glow-primary);
  display: grid; place-items: center;
  font-size: 1.15rem;
  opacity: 0; transform: translateY(20px);
  pointer-events: none;
  transition: all var(--speed) var(--ease);
  z-index: 150;
  cursor: pointer;
}
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ---------- 39. MOBILE BOTTOM NAV ---------- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; inset-inline: 0;
  z-index: 120;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.mobile-nav .mn-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 8px 4px;
  border-radius: var(--r-md);
  font-size: .62rem;
  font-weight: 800;
  color: var(--text-3);
  transition: all var(--speed) var(--ease);
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
}
.mobile-nav .mn-item .mn-ico { font-size: 1.15rem; }
.mobile-nav .mn-item.active { color: var(--brand-2); }
.mobile-nav .mn-item.active .mn-ico { transform: translateY(-2px); filter: drop-shadow(0 4px 8px rgba(37,99,235,.4)); }

/* ---------- 40. SURVEY / CHALLENGE CARDS ---------- */
.survey-card { padding: 20px; }
.survey-card .survey-ico { width: 56px; height: 56px; border-radius: var(--r-md); background: var(--grad-primary); display: grid; place-items: center; font-size: 1.5rem; color: #fff; margin-bottom: 12px; box-shadow: var(--glow-primary); }
.survey-card .survey-title { font-weight: 800; font-size: 1rem; margin-bottom: 4px; }
.survey-card .survey-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sv-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--r-full); background: var(--chip-bg); font-size: .76rem; font-weight: 700; color: var(--text-2); }
.survey-card .survey-progress { height: 6px; border-radius: 99px; background: var(--chip-bg); overflow: hidden; margin-bottom: 8px; }
.survey-card .survey-progress .sp-fill { display: block; height: 100%; background: var(--grad-accent); border-radius: 99px; }

.challenge-track { display: flex; flex-direction: column; gap: 14px; }
.ch-track-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-2); transition: all var(--speed); margin-bottom: 8px; }
.ch-track-item:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.ch-track-item.done { border-color: rgba(0,230,118,.4); background: rgba(0,230,118,.05); }
.ch-track-item .ct-ico { width: 46px; height: 46px; border-radius: var(--r-sm); background: var(--chip-bg); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.ch-track-item.done .ct-ico { background: var(--grad-success); color: #fff; }
.ch-track-item .ct-body { flex: 1; min-width: 0; }
.ch-track-item .ct-title { font-weight: 800; font-size: .9rem; }
.ch-track-item .ct-sub { font-size: .76rem; color: var(--text-3); }
.ch-track-item .ct-reward { font-weight: 900; color: var(--warning); font-size: .88rem; white-space: nowrap; }
.ch-track-item .ct-progress { width: 90px; height: 7px; border-radius: 99px; background: var(--chip-bg); overflow: hidden; flex-shrink: 0; }
.ch-track-item .ct-progress > span { display: block; height: 100%; border-radius: 99px; background: var(--grad-accent); }

/* ---------- 41. EVENTS ---------- */
.event-card { position: relative; overflow: hidden; cursor: pointer; padding: 18px; }
.event-card .ev-badge { position: absolute; top: 14px; inset-inline-start: 14px; font-size: 1.3rem; z-index: 2; animation: wiggle 3s ease-in-out infinite; }
.event-card .ev-name { font-weight: 800; font-size: 1rem; margin-top: 8px; }
.event-card .ev-sub { font-size: .82rem; color: var(--text-2); margin: 6px 0; }
.event-card .ev-date { font-size: .76rem; color: var(--text-3); }
.event-card .ev-reward { font-weight: 900; color: var(--warning); margin-top: 8px; }

/* ---------- 42. BLOG ---------- */
.blog-card { padding: 18px; text-align: center; }
.blog-card .blog-thumb {
  width: 56px; height: 56px; border-radius: var(--r-md);
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 1.5rem; color: #fff;
  margin: 0 auto 10px;
}
.blog-card .blog-title { font-weight: 800; font-size: .92rem; margin-bottom: 6px; }

/* ---------- 43. PROMO ---------- */
.promo-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-2); margin-bottom: 8px; }
.promo-card .pc-ico { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--grad-accent); display: grid; place-items: center; font-size: 1.3rem; color: #2a1600; flex-shrink: 0; }
.promo-card .pc-body { flex: 1; }
.promo-card .pc-code { font-family: 'Consolas', monospace; font-weight: 900; letter-spacing: .12em; color: var(--brand-2); }
.promo-card .pc-title { font-weight: 800; font-size: .88rem; }
.promo-card .pc-sub { font-size: .76rem; color: var(--text-3); }
.promo-chip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--chip-bg); margin-bottom: 8px; }
.promo-chip .pc-ico { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--grad-accent); display: grid; place-items: center; font-size: 1rem; color: #2a1600; }

/* ---------- 44. ALERT BANNERS ---------- */
.alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); margin-bottom: 14px; font-size: .88rem; border: 1px solid var(--border); }
.alert .a-ico { font-size: 1.15rem; flex-shrink: 0; }
.alert-info { background: rgba(0,176,255,.08); border-color: rgba(0,176,255,.3); color: var(--info); }
.alert-success { background: rgba(0,230,118,.08); border-color: rgba(0,230,118,.3); color: var(--success); }
.alert-warning { background: rgba(255,193,7,.08); border-color: rgba(255,193,7,.3); color: var(--warning); }
.alert-danger { background: rgba(255,61,113,.08); border-color: rgba(255,61,113,.3); color: var(--danger); }
.alert .a-body { flex: 1; color: var(--text); }
.alert .a-body .a-title { font-weight: 800; margin-bottom: 2px; }

/* ---------- 45. FEATURE TILES ---------- */
.feature-tile { text-align: center; padding: 22px 14px; }
.feature-tile .ft-ico {
  width: 62px; height: 62px;
  margin: 0 auto 12px;
  border-radius: var(--r-lg);
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 1.7rem; color: #fff;
  box-shadow: var(--glow-primary);
  animation: float 4s ease-in-out infinite;
}
.feature-tile .ft-title { font-weight: 800; font-size: .94rem; margin-bottom: 4px; }
.feature-tile .ft-sub { font-size: .8rem; color: var(--text-3); }

/* ---------- 46. BRAND ROW ---------- */
.brand-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand-logo {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  background: var(--chip-bg);
  border: 1px solid var(--border);
  font-weight: 800; font-size: .84rem;
  color: var(--text-2);
  transition: all var(--speed);
}
.brand-logo:hover { border-color: var(--brand-2); color: var(--brand-2); transform: translateY(-2px); }
.brand-logo .bl-ico { width: 24px; height: 24px; border-radius: 6px; background: var(--grad-primary); display: grid; place-items: center; font-size: .8rem; color: #fff; }

/* ---------- 47. NEWSLETTER ---------- */
.newsletter { padding: 26px; text-align: center; background: var(--grad-primary); border-radius: var(--r-xl); color: #fff; position: relative; overflow: hidden; }
.newsletter::before { content: '✉️'; position: absolute; font-size: 8rem; opacity: .08; top: -20px; inset-inline-end: -10px; transform: rotate(-12deg); }
.newsletter .nl-title { font-size: 1.5rem; font-weight: 900; margin-bottom: 6px; }
.newsletter .nl-sub { opacity: .9; font-size: .92rem; margin-bottom: 18px; }
.newsletter .nl-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; }
.newsletter .nl-form .input { border: none; border-radius: var(--r-full); padding: 14px 22px; }
.newsletter .nl-form .btn { background: var(--bg-2); color: var(--brand-1); }

/* ---------- 48. CONFIRM DIALOG ---------- */
.confirm-dialog { text-align: center; }
.confirm-dialog .cd-ico { font-size: 3.4rem; margin-bottom: 12px; display: block; }
.confirm-dialog .cd-title { font-size: 1.2rem; font-weight: 900; margin-bottom: 6px; }
.confirm-dialog .cd-body { color: var(--text-2); font-size: .9rem; margin-bottom: 22px; }

/* ---------- 49. OFFER MODAL DETAIL ---------- */
.offer-detail-hero {
  padding: 28px;
  border-radius: var(--r-lg);
  color: #fff;
  text-align: center;
  margin-bottom: 18px;
}
.offer-detail-hero .odh-logo {
  width: 80px; height: 80px;
  margin: 0 auto 12px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.18);
  display: grid; place-items: center;
  font-size: 2.4rem;
}
.offer-detail-hero .odh-name { font-weight: 900; font-size: 1.3rem; }
.offer-detail-hero .odh-provider { font-size: .86rem; opacity: .9; margin-top: 4px; }

.od-stat { padding: 14px; border-radius: var(--r-md); background: var(--chip-bg); text-align: center; }
.od-stat .od-stat-v { font-weight: 900; font-size: 1.15rem; }
.od-stat .od-stat-l { font-size: .72rem; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

.offer-milestone { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--chip-bg); border: 1px solid var(--border); margin-bottom: 8px; }
.offer-milestone .om-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--grad-primary); color: #fff; display: grid; place-items: center; font-size: .8rem; }
.offer-milestone .om-label { flex: 1; font-weight: 700; font-size: .86rem; }
.offer-milestone .om-reward { font-weight: 900; color: var(--warning); }

.howto { padding-inline-start: 22px; list-style: decimal; }
.howto li { padding: 6px 0; color: var(--text-2); }

/* ---------- 50. KV ROW (key-value) ---------- */
.kv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.kv-row:last-child { border-bottom: none; }
.kv-row .kv-label { color: var(--text-3); font-weight: 600; font-size: .84rem; }
.kv-row .kv-value { font-weight: 800; font-size: .9rem; text-align: end; }

/* ---------- 51. SURVEY DETAIL ---------- */
.survey-detail { text-align: center; padding: 16px; }
.survey-ico-lg {
  width: 72px; height: 72px; border-radius: var(--r-md);
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 2rem; color: #fff;
  margin: 0 auto 14px;
  box-shadow: var(--glow-primary);
}
.survey-detail-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }

/* ---------- 52. REWARD CONFIRM ---------- */
.reward-confirm { text-align: center; }
.reward-confirm .rw-logo {
  width: 72px; height: 72px; border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 2rem; color: #fff;
  margin: 0 auto 12px;
}
.rd-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.rd-option { padding: 10px; border-radius: var(--r-md); border: 2px solid var(--border); background: var(--chip-bg); text-align: center; font-size: .82rem; font-weight: 700; cursor: pointer; transition: all var(--speed); }
.rd-option:hover { border-color: var(--brand-2); }
.rd-option.selected { border-color: var(--brand-2); background: rgba(37,99,235,.1); box-shadow: var(--glow-primary); }

/* ---------- 53. MINI CALENDAR ---------- */
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mini-cal .cal-head { font-size: .66rem; font-weight: 800; text-align: center; color: var(--text-3); padding: 4px 0; }
.mini-cal .cal-day { aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r-sm); font-size: .8rem; font-weight: 600; color: var(--text-2); transition: all var(--speed); }
.mini-cal .cal-day:hover { background: var(--chip-bg); }
.mini-cal .cal-day.today { background: var(--grad-primary); color: #fff; box-shadow: var(--glow-primary); }
.mini-cal .cal-day.muted { color: var(--text-3); opacity: .5; }
.mini-cal .cal-day.marked { background: rgba(0,230,118,.18); color: var(--success); font-weight: 800; }

/* ---------- 54. STREAK BAR ---------- */
.streak-bar { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.sb-day { flex: 1; text-align: center; padding: 10px 4px; border-radius: var(--r-md); background: var(--chip-bg); }
.sb-day.done { background: var(--grad-success); color: #fff; }
.sb-day.active { background: var(--grad-primary); color: #fff; box-shadow: var(--glow-primary); }
.sbd-ico { font-size: 1.2rem; display: block; }
.sbd-name { font-size: .7rem; font-weight: 700; margin-top: 4px; display: block; }

/* ---------- 55. KNOWLEDGE BASE ---------- */
.kb-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-2);
  cursor: pointer;
  transition: all var(--speed);
  width: 100%; text-align: start;
  margin-bottom: 8px;
}
.kb-item:hover { border-color: var(--brand-2); transform: translateX(4px); }
.kb-item .kb-ico { font-size: 1.4rem; }
.kb-item .kb-label { flex: 1; font-weight: 700; }
.kb-item .kb-chev { color: var(--text-3); }

/* ---------- 56. LOG ROW ---------- */
.log-row {
  display: grid;
  grid-template-columns: 44px 120px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.log-row:last-child { border-bottom: none; }
.log-row .log-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: .9rem; background: var(--chip-bg); }
.log-row .log-time { color: var(--text-3); font-size: .74rem; font-variant-numeric: tabular-nums; }
.log-row .log-action { font-weight: 700; }
.log-row .log-detail { color: var(--text-2); font-size: .78rem; }

/* ---------- 57. SPINNER ---------- */
.spinner-sm {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 3px solid var(--chip-bg);
  border-top-color: var(--brand-2);
  animation: spin .8s linear infinite;
  display: inline-block;
}

/* ============================================================================
ADMIN PANEL STYLES
============================================================================ */
body.admin-body { padding-top: 0; }

.admin-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--grad-bg);
  background-attachment: fixed;
  position: relative;
}
.admin-auth .aa-card {
  width: 100%; max-width: 460px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 38px 34px;
  box-shadow: var(--shadow-3);
  position: relative; overflow: hidden;
}
.admin-auth .aa-card::before {
  content: '';
  position: absolute;
  top: -90px; inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.35), transparent 70%);
  filter: blur(20px);
}
.admin-auth .aa-logo {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  margin-bottom: 26px;
  position: relative;
}
.admin-auth .aa-logo .aa-badge {
  width: 72px; height: 72px;
  border-radius: var(--r-lg);
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 2rem; color: #fff;
  box-shadow: var(--glow-primary);
  animation: pulse-glow 4s ease-in-out infinite;
}
.admin-auth .aa-role-tag {
  padding: 4px 14px; border-radius: var(--r-full);
  background: var(--grad-accent);
  color: #2a1600;
  font-size: .72rem; font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.admin-shell { display: flex; min-height: 100vh; }

.admin-side {
  width: var(--side-w);
  background: var(--bg-2);
  border-inline-end: 1px solid var(--border);
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
  z-index: 60;
  transition: transform .32s var(--ease);
}
.admin-side .side-head { padding: 20px 18px; border-bottom: 1px solid var(--border); }
.admin-side .side-group { padding: 10px 12px; }
.admin-side .side-group-label {
  font-size: .66rem; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-3);
  padding: 12px 14px 6px;
}
.admin-side .side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-weight: 600; font-size: .88rem;
  transition: all var(--speed) var(--ease);
  margin-bottom: 2px;
  cursor: pointer;
}
.admin-side .side-link:hover { background: var(--chip-bg); color: var(--text); transform: translateX(3px); }
.admin-side .side-link.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--glow-primary);
}
.admin-side .side-link .s-ico { width: 22px; text-align: center; font-size: 1.05rem; flex-shrink: 0; }
.admin-side .side-link .s-label { flex: 1; }
.admin-side .side-link .s-badge {
  margin-inline-start: auto;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--grad-danger);
  color: #fff;
  font-size: .66rem; font-weight: 800;
  display: grid; place-items: center;
}
.admin-side .side-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--border); }
.admin-side .side-search { position: relative; margin: 12px 10px; }
.admin-side .side-search .input { padding: 9px 12px; padding-inline-start: 34px; font-size: .8rem; border-radius: var(--r-md); }
.admin-side .side-search .ss-ico { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: .85rem; pointer-events: none; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.admin-content { padding: 24px; flex: 1; }

.admin-page { display: none; animation: slide-up .45s var(--ease) both; }
.admin-page.active { display: block; }

.page-subhead { margin-bottom: 22px; }
.page-subhead .ps-title { font-size: 1.35rem; font-weight: 900; margin-bottom: 4px; }
.page-subhead .ps-sub { color: var(--text-3); font-size: .88rem; }

.quick-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.qs { padding: 16px; border-radius: var(--r-md); background: var(--chip-bg); border: 1px solid var(--border); }
.qs .qs-label { font-size: .74rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.qs .qs-value { font-size: 1.3rem; font-weight: 900; margin-top: 4px; font-variant-numeric: tabular-nums; }
.qs.grad { color: #fff; border: none; }
.qs.grad .qs-label { color: rgba(255,255,255,.75); }

.kpi-glass { position: relative; padding: 20px; border-radius: var(--r-lg); background: var(--bg-glass); backdrop-filter: blur(14px); border: 1px solid var(--border); overflow: hidden; transition: all var(--speed) var(--ease); }
.kpi-glass:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.kpi-glass::after { content: ''; position: absolute; top: 0; inset-inline-start: 0; width: 100%; height: 3px; background: var(--grad-primary); }
.kpi-glass .kg-label { font-size: .74rem; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.kpi-glass .kg-value { font-size: 1.9rem; font-weight: 900; margin-top: 6px; letter-spacing: -.02em; }
.kpi-glass .kg-sub { font-size: .78rem; color: var(--text-3); margin-top: 4px; }

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

.chart-wrap { position: relative; height: 320px; }
.chart-wrap-sm { height: 220px; }
.chart-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--text-3);
  font-size: .84rem; font-weight: 600;
}

.tbl-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tbl-actions .mini-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: .82rem;
  display: grid; place-items: center;
  transition: all var(--speed) var(--ease);
  cursor: pointer;
}
.tbl-actions .mini-btn:hover { transform: translateY(-2px); border-color: var(--brand-2); color: var(--brand-2); }
.tbl-actions .mini-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.tbl-actions .mini-btn.success:hover { border-color: var(--success); color: var(--success); }

.log-stream { max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; }

.activity-feed { display: flex; flex-direction: column; gap: 0; }
.af-item { display: flex; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--border); }
.af-item:last-child { border-bottom: none; }
.af-item .af-ico { width: 38px; height: 38px; border-radius: 50%; background: var(--chip-bg); display: grid; place-items: center; font-size: .95rem; flex-shrink: 0; }
.af-item .af-body { flex: 1; min-width: 0; }
.af-item .af-title { font-weight: 700; font-size: .86rem; }
.af-item .af-sub { font-size: .76rem; color: var(--text-3); }
.af-item .af-time { font-size: .7rem; color: var(--text-3); white-space: nowrap; }

.slim-tabs { display: flex; border-bottom: 1px solid var(--border); gap: 4px; margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.slim-tabs::-webkit-scrollbar { display: none; }
.slim-tabs .slim-tab { padding: 12px 16px; font-weight: 700; font-size: .86rem; color: var(--text-2); border: none; background: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: all var(--speed); cursor: pointer; }
.slim-tabs .slim-tab:hover { color: var(--text); }
.slim-tabs .slim-tab.active { color: var(--brand-2); border-bottom-color: var(--brand-2); }

.callout { display: flex; gap: 12px; padding: 16px; border-radius: var(--r-md); border-inline-start: 4px solid var(--brand-2); background: rgba(37,99,235,.07); margin-bottom: 16px; }
.callout .co-ico { font-size: 1.2rem; }
.callout.danger { border-inline-start-color: var(--danger); background: rgba(255,61,113,.07); }
.callout.success { border-inline-start-color: var(--success); background: rgba(0,230,118,.07); }
.callout.warning { border-inline-start-color: var(--warning); background: rgba(255,193,7,.07); }

.role-bar { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-full); font-weight: 800; font-size: .74rem; border: 1px solid var(--border); }
.role-super { background: rgba(255,61,113,.12); color: var(--danger); border-color: rgba(255,61,113,.3); }
.role-finance { background: rgba(255,193,7,.12); color: var(--warning); border-color: rgba(255,193,7,.3); }
.role-support { background: rgba(0,230,118,.12); color: var(--success); border-color: rgba(0,230,118,.3); }

.rte { border: 1.5px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; }
.rte-toolbar { display: flex; gap: 4px; padding: 8px; background: var(--chip-bg); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rte-toolbar button { width: 34px; height: 34px; border-radius: var(--r-sm); border: none; background: transparent; color: var(--text-2); font-weight: 800; font-size: .86rem; transition: all var(--speed); cursor: pointer; }
.rte-toolbar button:hover { background: var(--bg-2); color: var(--brand-2); }
.rte-area { min-height: 200px; padding: 14px; outline: none; font-size: .92rem; line-height: 1.7; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--text-3); }

.dnd-list { display: flex; flex-direction: column; gap: 8px; }
.dnd-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-2); cursor: grab; transition: all var(--speed); }
.dnd-item:hover { border-color: var(--brand-2); }
.dnd-item .grip { color: var(--text-3); cursor: grab; font-size: 1.1rem; }

.pv-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .82rem; }
.pv-status .pv-dot { width: 10px; height: 10px; border-radius: 50%; }
.pv-live { color: var(--success); }
.pv-live .pv-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.pv-down { color: var(--danger); }
.pv-down .pv-dot { background: var(--danger); }

.stat-mini { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.stat-mini .sm-ico { width: 42px; height: 42px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 1.05rem; flex-shrink: 0; }
.stat-mini .sm-value { font-weight: 900; font-size: 1.02rem; line-height: 1.2; }
.stat-mini .sm-label { font-size: .74rem; color: var(--text-3); font-weight: 600; }

/* ============================================================================
RESPONSIVE
============================================================================ */
@media (max-width: 1200px) {
  .grid-6 { grid-template-columns: repeat(4, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-side {
    position: fixed;
    inset-inline-start: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
  }
  html[dir="rtl"] .admin-side { transform: translateX(100%); }
  .admin-mobile-open .admin-side { transform: translateX(0); box-shadow: var(--shadow-3); }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: grid; }
  .mobile-nav { display: grid; }
  .site { padding-bottom: 110px; }
  .balance-pill { font-size: .8rem; padding: 7px 12px; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 34px 24px; }
  .nav-inner { padding: 0 14px; gap: 10px; }
  .site { padding: 0 14px 60px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .toast-wrap { inset-inline-end: 12px; inset-inline-start: 12px; max-width: none; }
  .newsletter .nl-form { flex-direction: column; }
}
@media (max-width: 480px) {
  .nav-logo span.txt { display: none; }
  .modal { padding: 20px 16px; }
  .profile-head { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .nav, .footer, .to-top, .toast-wrap, .confetti, .particles, .hamburger, .drawer, .mobile-nav { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
}

/* ============================================================================
END OF STYLESHEET
============================================================================ */
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    function isAuth() { return request.auth != null; }
    function isOwner(uid) { return isAuth() && request.auth.uid == uid; }
    function isAdmin() {
      return isAuth() && (
        exists(/databases/$(database)/documents/admin_users/$(request.auth.uid)) ||
        exists(/databases/$(database)/documents/admin_users/$(request.auth.token.email))
      );
    }
    match /offers/{d} { allow read: if true; allow write: if isAdmin(); }
    match /games/{d} { allow read: if true; allow write: if isAdmin(); }
    match /surveys/{d} { allow read: if true; allow write: if isAdmin(); }
    match /rewards/{d} { allow read: if true; allow write: if isAdmin(); }
    match /providers/{d} { allow read: if true; allow write: if isAdmin(); }
    match /faqs/{d} { allow read: if true; allow write: if isAdmin(); }
    match /events/{d} { allow read: if true; allow write: if isAdmin(); }
    match /promos/{d} { allow read: if true; allow write: if isAdmin(); }
    match /posts/{d} { allow read: if true; allow write: if isAdmin(); }
    match /settings/{d} { allow read: if true; allow write: if isAdmin(); }
    match /users/{uid} {
      allow read: if isOwner(uid) || isAdmin();
      allow create: if isOwner(uid);
      allow update: if isOwner(uid) || isAdmin();
      allow delete: if isAdmin();
    }
    match /admin_users/{id} {
      allow read: if isOwner(id) || isAdmin() || (isAuth() && request.auth.token.email == "kenven@admin.com");
      allow create: if (isOwner(id) && request.auth.token.email == "kenven@admin.com") || isAdmin();
      allow update, delete: if isAdmin();
    }
    match /ledger/{d} {
      allow read: if isAuth() && (resource.data.uid == request.auth.uid || isAdmin());
      allow create: if isAuth() && request.resource.data.uid == request.auth.uid;
      allow update, delete: if isAdmin();
    }
    match /notifications/{d} {
      allow read: if isAuth() && (resource.data.uid == request.auth.uid || isAdmin());
      allow create: if isAuth();
      allow update, delete: if isAuth() && (resource.data.uid == request.auth.uid || isAdmin());
    }
    match /tickets/{d} {
      allow read: if isAuth() && (resource.data.uid == request.auth.uid || isAdmin());
      allow create: if isAuth() && request.resource.data.uid == request.auth.uid;
      allow update: if isAdmin();
      allow delete: if isAdmin();
    }
    match /orders/{d} {
      allow read: if isAuth() && (resource.data.uid == request.auth.uid || isAdmin());
      allow create: if isAuth() && request.resource.data.uid == request.auth.uid;
      allow update: if isAdmin();
      allow delete: if isAdmin();
    }
    match /withdrawals/{d} {
      allow read: if isAuth() && (resource.data.uid == request.auth.uid || isAdmin());
      allow create: if isAuth() && request.resource.data.uid == request.auth.uid;
      allow update: if isAdmin();
      allow delete: if isAdmin();
    }
    match /referrals/{d} {
      allow read: if isAuth() && (resource.data.referrerId == request.auth.uid || resource.data.referredId == request.auth.uid || isAdmin());
      allow create: if isAuth();
      allow update, delete: if isAdmin();
    }
    match /admin_logs/{d} { allow read, create: if isAdmin(); allow update, delete: if isAdmin(); }
    match /fraud_events/{d} { allow read: if isAdmin(); allow create: if isAuth(); allow update, delete: if isAdmin(); }
    match /{document=**} { allow read, write: if false; }
  }
}

/* Functional maintenance overlay */
#maintenanceOverlay{position:fixed;inset:0;z-index:999999;display:grid;place-items:center;background:rgba(5,8,18,.96);backdrop-filter:blur(14px);padding:24px}
#maintenanceOverlay .maintenance-card{max-width:560px;text-align:center;padding:42px 30px;border:1px solid var(--border-strong);background:var(--bg-glass-strong);border-radius:var(--r-xl);box-shadow:var(--shadow-3)}
#maintenanceOverlay .maintenance-icon{font-size:4rem;margin-bottom:10px}
#maintenanceOverlay h2{font-size:2rem;margin-bottom:10px}
#maintenanceOverlay p{color:var(--text-2)}
.maintenance-active .site{filter:blur(2px)}
.ad-provider-host{min-height:1px;display:flex;justify-content:center;align-items:center}
