/* ============================================================
   NileDogs (NDOG) — Stylesheet
   Premium futuristic crypto theme · Dark mode first
   Palette: Nile Blue + Gold + Neon + Glassmorphism
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Core palette */
  --bg-0:        #050b1a;
  --bg-1:        #0a1428;
  --bg-2:        #0a1f44;
  --bg-3:        #103463;
  --nile:        #1e90ff;
  --nile-deep:   #0b5fa5;
  --nile-soft:   #4ec0ff;
  --gold:        #ffd700;
  --gold-2:      #ffb347;
  --gold-3:      #ffe9a8;
  --neon-cyan:   #00f0ff;
  --neon-pink:   #ff6ec7;
  --neon-green:  #36f1a3;
  --neon-violet: #a06bff;

  /* Text */
  --text:        #eaf2ff;
  --text-dim:    #8da4c8;
  --text-mute:   #5d6f93;

  /* Glass */
  --glass-bg:    rgba(16, 52, 99, 0.18);
  --glass-bd:    rgba(78, 192, 255, 0.18);
  --glass-hi:    rgba(255, 255, 255, 0.06);

  /* Effects */
  --glow-nile:   0 0 24px rgba(30, 144, 255, 0.55);
  --glow-gold:   0 0 24px rgba(255, 215, 0, 0.55);
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.45);

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* Layout */
  --topbar-h:    60px;
  --bottomnav-h: 64px;
  --maxw:        720px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.83, 0, 0.17, 1);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--nile-soft); text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font: inherit; }
.hidden { display: none !important; }
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-bd);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow-card), inset 0 1px 0 var(--glass-hi);
}

/* ---------- PARTICLES & ORBS ---------- */
#particles {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5;
  animation: floatOrb 18s var(--ease-in-out) infinite;
}
.orb--1 { width: 320px; height: 320px; background: var(--nile);     top: -80px;  left: -80px; }
.orb--2 { width: 280px; height: 280px; background: var(--gold);     bottom: -60px; right: -60px; animation-delay: -6s; }
.orb--3 { width: 240px; height: 240px; background: var(--neon-violet); top: 40%; left: 60%; animation-delay: -12s; }
@keyframes floatOrb {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(40px,-30px) scale(1.1); }
  66%      { transform: translate(-30px,40px) scale(0.95); }
}

/* ---------- PRELOADER ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, var(--bg-2) 0%, var(--bg-0) 70%);
  transition: opacity .6s var(--ease-out);
}
.preloader.done { opacity: 0; pointer-events: none; }
.preloader__logo { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.preloader__dog { font-size: 60px; animation: bob 1.4s var(--ease-in-out) infinite; }
.preloader__ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--gold);
  border-right-color: var(--nile);
  animation: spin 1.1s linear infinite;
  filter: drop-shadow(0 0 8px var(--gold));
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
.preloader__title {
  margin-top: 24px; font-size: 28px; font-weight: 800; letter-spacing: 4px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.35);
}
.preloader__bar { width: 220px; height: 4px; margin-top: 20px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.preloader__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--nile), var(--gold)); animation: load 1.4s var(--ease-in-out) forwards; }
@keyframes load { to { width: 100%; } }
.preloader__hint { margin-top: 12px; font-size: 13px; color: var(--text-mute); letter-spacing: 1px; }

/* ---------- TOASTS ---------- */
.toast-host {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: 92%; max-width: 420px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: rgba(10, 31, 68, 0.92);
  border: 1px solid var(--glass-bd);
  backdrop-filter: blur(14px);
  color: var(--text);
  padding: 12px 18px; border-radius: var(--r-md);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  animation: toastIn .35s var(--ease-out), toastOut .35s var(--ease-out) 3s forwards;
  min-width: 240px;
}
.toast--ok   { border-color: var(--neon-green); box-shadow: 0 0 24px rgba(54,241,163,0.25); }
.toast--err  { border-color: var(--neon-pink);  box-shadow: 0 0 24px rgba(255,110,199,0.25); }
.toast--info { border-color: var(--nile-soft);  box-shadow: 0 0 24px rgba(78,192,255,0.25); }
.toast__icon { font-size: 18px; }
@keyframes toastIn  { from { transform: translateY(-20px); opacity: 0; } }
@keyframes toastOut { to   { transform: translateY(-20px); opacity: 0; } }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-md);
  font-weight: 700; letter-spacing: .3px;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .2s;
  user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn--sm    { padding: 8px 14px; font-size: 13px; }
.btn--lg    { padding: 16px 30px; font-size: 17px; }
.btn--gold  {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1306;
  box-shadow: var(--glow-gold);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(255,215,0,0.55); }
.btn--ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-bd);
  color: var(--text);
}
.btn--ghost:hover { background: rgba(255,255,255,0.08); }
.btn--google {
  background: #fff; color: #1a1a1a;
  padding: 14px 28px; font-weight: 600; gap: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  width: 100%;
}
.btn--google:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(255,255,255,0.2); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* ---------- LOGIN SCREEN ---------- */
.screen--login {
  position: relative; z-index: 2;
  min-height: 100dvh; padding: 32px 20px;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .6s var(--ease-out);
}
.login__wrap { width: 100%; max-width: 440px; text-align: center; }
.login__brand { margin-bottom: 24px; animation: floatBrand 4s var(--ease-in-out) infinite; }
@keyframes floatBrand { 50% { transform: translateY(-6px); } }
.login__logo {
  width: 96px; height: 96px; margin: 0 auto 12px;
  font-size: 56px; display: grid; place-items: center;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  box-shadow: var(--glow-nile), inset 0 1px 0 var(--glass-hi);
  border: 1px solid var(--glass-bd);
}
.login__title {
  font-size: 38px; font-weight: 900; letter-spacing: 3px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2) 60%, var(--gold-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(255,215,0,0.3);
}
.login__ticker { font-size: 13px; color: var(--text-dim); letter-spacing: 4px; margin-top: 4px; }
.login__tagline {
  font-size: 15px; color: var(--text-dim); line-height: 1.6; margin-bottom: 24px;
}
.login__tagline strong { color: var(--gold); }
.login__countdown {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 28px;
}
.lc__unit {
  background: var(--glass-bg);
  border: 1px solid var(--glass-bd);
  backdrop-filter: blur(12px);
  border-radius: var(--r-md);
  padding: 14px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.lc__unit span {
  font-size: 26px; font-weight: 800; color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(255,215,0,0.4);
}
.lc__unit small { font-size: 10px; color: var(--text-mute); letter-spacing: 1.5px; text-transform: uppercase; }
.login__note { margin-top: 16px; font-size: 12px; color: var(--text-mute); }
.login__note a { color: var(--nile-soft); }
.login__features {
  margin-top: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.lf {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass-bg); border: 1px solid var(--glass-bd);
  padding: 12px; border-radius: var(--r-md); text-align: left;
}
.lf span { font-size: 22px; }
.lf p { font-size: 13px; color: var(--text-dim); }

/* ---------- APP SHELL ---------- */
.app-shell {
  position: relative; z-index: 2;
  min-height: 100dvh;
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0));
  animation: fadeIn .5s var(--ease-out);
}
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- TOPBAR ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; padding-top: env(safe-area-inset-top, 0);
  border-radius: 0; border-left: 0; border-right: 0; border-top: 0;
}
.topbar__menu { display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.topbar__menu span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }
.topbar__brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); }
.topbar__logo { font-size: 22px; }
.topbar__name { letter-spacing: 1.5px; background: linear-gradient(135deg, var(--gold), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar__balance {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,215,0,0.08); border: 1px solid rgba(255,215,0,0.25);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.topbar__bal-icon { font-size: 14px; }
.topbar__bal-num { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------- SIDENAV ---------- */
.sidenav {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px;
  z-index: 70; padding: 24px 18px; padding-top: calc(24px + env(safe-area-inset-top, 0));
  display: flex; flex-direction: column; gap: 14px;
  transform: translateX(-100%); transition: transform .35s var(--ease-out);
  border-radius: 0; border-top: 0; border-bottom: 0; border-left: 0;
}
.sidenav.open { transform: translateX(0); }
.sidenav__head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0 18px; border-bottom: 1px solid var(--glass-bd); }
.sidenav__avatar { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--gold); box-shadow: var(--glow-gold); }
.sidenav__name { font-weight: 700; font-size: 16px; }
.sidenav__code { font-size: 12px; color: var(--gold); letter-spacing: 1px; font-weight: 700; }
.sidenav__links { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--r-md); color: var(--text-dim); font-weight: 600;
  transition: background .2s, color .2s, transform .15s;
}
.nav-link__icon { font-size: 18px; width: 24px; flex: none; text-align: center; line-height: 1; }
.nav-link__label { flex: 1; line-height: 1.3; }
.nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-link.active {
  background: linear-gradient(135deg, rgba(30,144,255,0.18), rgba(255,215,0,0.10));
  color: var(--gold); border: 1px solid var(--glass-bd);
}
.sidenav__scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .35s var(--ease-out);
}
.sidenav__scrim.show { opacity: 1; pointer-events: auto; }

/* ---------- BOTTOM NAV ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--bottomnav-h);
  z-index: 50;
  display: flex; align-items: stretch; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
  border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0;
}
.bn-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-mute); font-size: 10px; font-weight: 600;
  transition: color .2s, transform .15s; padding-top: 6px;
}
.bn-link span { font-size: 20px; transition: transform .2s; }
.bn-link.active { color: var(--gold); }
.bn-link.active span { transform: translateY(-2px) scale(1.1); filter: drop-shadow(0 0 6px var(--gold)); }
.bn-link small { letter-spacing: 0.5px; }

/* ---------- VIEWPORT ---------- */
.viewport { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 14px 14px 24px; }
.view { display: none !important; animation: viewIn .45s var(--ease-out); }
.view--active { display: block !important; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } }
.view__in { display: flex; flex-direction: column; gap: 16px; }

/* ---------- DASHBOARD ---------- */
.dash__hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px; border-radius: var(--r-lg);
}
.dash__hero-l { display: flex; align-items: center; gap: 14px; }
.dash__avatar { width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--gold); box-shadow: var(--glow-gold); }
.dash__hello { font-size: 12px; color: var(--text-dim); }
.dash__name { font-size: 20px; font-weight: 800; }
.dash__meta { font-size: 11px; color: var(--text-mute); margin-top: 2px; }
.dash__hero-r { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dash__rank-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,215,0,0.1); border: 1px solid rgba(255,215,0,0.3);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.dash__rank-icon { font-size: 16px; }

.dash__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.stat-card {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: var(--r-lg);
  transition: transform .25s var(--ease-out), box-shadow .25s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--glass-bd); }
.stat-card__icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--glass-bd);
  flex-shrink: 0;
}
.stat-card__label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.stat-card__value { font-size: 22px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-card__sub { font-size: 11px; color: var(--text-mute); }

.ref-card { padding: 18px; border-radius: var(--r-lg); }
.ref-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ref-card__head h3 { font-size: 15px; }
.ref-card__code {
  font-size: 22px; font-weight: 900; color: var(--gold);
  letter-spacing: 3px; text-align: center; padding: 10px 0;
  text-shadow: 0 0 16px rgba(255,215,0,0.4);
}
.ref-card__link {
  font-size: 11px; color: var(--text-dim); text-align: center;
  word-break: break-all; padding: 8px 12px; background: rgba(0,0,0,0.25); border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.ref-card__share { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

.share-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-bd);
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}
.share-btn svg { display: block; }
.share-btn:hover { transform: translateY(-2px) scale(1.05); }
.share--wa:hover  { background: #25D366; color: #fff; box-shadow: 0 0 16px #25D366; border-color: #25D366; }
.share--tg:hover  { background: #229ED9; color: #fff; box-shadow: 0 0 16px #229ED9; border-color: #229ED9; }
.share--fb:hover  { background: #1877F2; color: #fff; box-shadow: 0 0 16px #1877F2; border-color: #1877F2; }
.share--x:hover   { background: #000; color: #fff; box-shadow: 0 0 16px rgba(255,255,255,0.4); border-color: #000; }
.share--ms:hover  { background: #0064FF; color: #fff; box-shadow: 0 0 16px #0064FF; border-color: #0064FF; }
.share--qr:hover  { background: var(--gold); color: #1a1306; box-shadow: var(--glow-gold); border-color: var(--gold); }

.level-card { padding: 18px; border-radius: var(--r-lg); }
.level-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.level-card__head h3 { font-size: 15px; }
.level-card__next { font-size: 12px; color: var(--gold); }
.level-track { height: 10px; background: rgba(0,0,0,0.4); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.level-track__fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--nile), var(--gold));
  border-radius: 999px;
  transition: width 1s var(--ease-out);
  box-shadow: 0 0 12px rgba(255,215,0,0.4);
}
.level-card__levels { display: flex; justify-content: space-between; }
.level-badge {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: var(--text-mute);
}
.level-badge .lb-icon { font-size: 22px; filter: grayscale(1) opacity(0.5); transition: filter .3s; }
.level-badge.unlocked .lb-icon { filter: none; }
.level-badge.unlocked .lb-name { color: var(--gold); font-weight: 700; }

.ea-banner {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(255,215,0,0.12), rgba(160,107,255,0.10));
  border-color: rgba(255,215,0,0.4);
}
.ea-banner__icon { font-size: 40px; animation: bob 2s var(--ease-in-out) infinite; }
.ea-banner__txt strong { display: block; font-size: 14px; color: var(--gold); }
.ea-banner__txt p { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }

/* ---------- CLAIM ---------- */
.claim__hero { padding: 28px 18px; border-radius: var(--r-xl); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.claim__ring { position: relative; width: 220px; height: 220px; }
.claim__ring svg { transform: rotate(-90deg); }
.claim__ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 8; }
.claim__ring-fg {
  fill: none; stroke: url(#gold); stroke-width: 8;
  stroke: var(--gold); stroke-linecap: round;
  stroke-dasharray: 628; stroke-dashoffset: 628;
  transition: stroke-dashoffset 1s var(--ease-out);
  filter: drop-shadow(0 0 8px var(--gold));
}
.claim__ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.claim__reward { font-size: 28px; font-weight: 900; color: var(--gold); text-shadow: 0 0 18px rgba(255,215,0,0.5); }
.claim__hint { font-size: 12px; color: var(--text-dim); }
.claim__streak {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  background: rgba(255,110,199,0.08); border: 1px solid rgba(255,110,199,0.25);
  padding: 8px 14px; border-radius: 999px;
}
.claim__streak strong { color: var(--neon-pink); }
.claim__mult { color: var(--gold); font-weight: 700; }
.claim__countdown { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.claim__countdown:empty { display: none; }

.claim__levels h3 { font-size: 15px; margin-bottom: 10px; padding: 0 4px; }
.claim__levels-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.claim-level {
  padding: 14px 6px; border-radius: var(--r-md); text-align: center;
  background: var(--glass-bg); border: 1px solid var(--glass-bd);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.claim-level:hover { transform: translateY(-2px); border-color: rgba(255,215,0,0.3); }
.claim-level__icon { font-size: 22px; line-height: 1; }
.claim-level__name { font-size: 11px; font-weight: 700; margin-top: 6px; }
.claim-level__req { font-size: 9px; color: var(--text-mute); margin-top: 2px; }
.claim-level.current { border-color: var(--gold); box-shadow: var(--glow-gold); background: linear-gradient(135deg, rgba(255,215,0,0.12), rgba(30,144,255,0.06)); }

.claim__history { padding: 18px; border-radius: var(--r-lg); }
.claim__history h3 { font-size: 15px; margin-bottom: 12px; }
.claim__history-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.claim-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; background: rgba(0,0,0,0.25); border-radius: var(--r-sm);
  font-size: 13px;
}
.claim-row__amt { font-weight: 800; color: var(--gold); }
.claim-row__date { color: var(--text-mute); font-size: 11px; }
.empty { padding: 24px 12px; text-align: center; color: var(--text-mute); font-size: 13px; }

/* ---------- REFERRAL ---------- */
.ref__hero { padding: 22px; border-radius: var(--r-lg); text-align: center; }
.ref__hero h2 { font-size: 22px; margin-bottom: 8px; }
.ref__hero p { font-size: 13px; color: var(--text-dim); }
.ref__hero strong { color: var(--gold); }
.ref__tiers { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 16px; }
.ref__tier {
  background: rgba(0,0,0,0.3); border: 1px solid var(--glass-bd);
  padding: 14px 8px; border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.ref__tier-l {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--nile), var(--gold));
  color: #1a1306; font-weight: 800;
}
.ref__tier-r strong { color: var(--gold); font-size: 18px; }

.ref__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ref__link-card { padding: 18px; border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 10px; }
.ref__link-card label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.ref__link-row { display: flex; gap: 8px; }
.ref__link-row input {
  flex: 1; padding: 12px 14px; border-radius: var(--r-md);
  background: rgba(0,0,0,0.4); border: 1px solid var(--glass-bd); color: var(--text);
  font-size: 13px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.ref__link-row input:focus { outline: 2px solid var(--nile); }
.ref__link-card .ref-card__share { justify-content: flex-start; margin-top: 4px; }

.ref__tree { padding: 18px; border-radius: var(--r-lg); }
.ref__tree h3 { font-size: 15px; margin-bottom: 12px; }
.ref__tree-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.ref-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: rgba(0,0,0,0.25); border-radius: var(--r-sm);
}
.ref-row__avatar { width: 36px; height: 36px; border-radius: 50%; }
.ref-row__meta { flex: 1; min-width: 0; }
.ref-row__name { font-size: 13px; font-weight: 600; }
.ref-row__sub { font-size: 11px; color: var(--text-mute); }
.ref-row__tier {
  background: rgba(255,215,0,0.1); color: var(--gold); font-size: 11px;
  padding: 4px 10px; border-radius: 999px; font-weight: 700;
}

/* ---------- MISSIONS ---------- */
.missions__tabs, .lb__tabs {
  display: flex; gap: 6px; padding: 6px; background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-bd); border-radius: var(--r-md);
  overflow-x: auto; scrollbar-width: none;
}
.missions__tabs::-webkit-scrollbar, .lb__tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1; min-width: max-content; padding: 10px 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; color: var(--text-dim); transition: all .2s;
}
.tab.active {
  background: linear-gradient(135deg, var(--nile), var(--gold));
  color: #1a1306;
}

.missions__list { display: flex; flex-direction: column; gap: 10px; }
.mission-card {
  padding: 14px; border-radius: var(--r-lg); display: flex; align-items: center; gap: 14px;
  background: var(--glass-bg); border: 1px solid var(--glass-bd);
}
.mission-card__icon {
  width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center;
  font-size: 20px; background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--glass-bd); flex-shrink: 0;
}
.mission-card__body { flex: 1; min-width: 0; }
.mission-card__title { font-size: 14px; font-weight: 700; }
.mission-card__desc { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.mission-card__reward { color: var(--gold); font-size: 13px; font-weight: 700; margin-top: 4px; }
.mission-card__action { flex-shrink: 0; }
.mission-card.done { opacity: 0.7; }
.mission-card.done .mission-card__title { color: var(--neon-green); }

.missions__fun { padding: 18px; border-radius: var(--r-lg); }
.missions__fun h3 { font-size: 15px; margin-bottom: 12px; }
.missions__fun-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-card {
  padding: 18px 14px; border-radius: var(--r-md); display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: linear-gradient(135deg, rgba(30,144,255,0.15), rgba(255,215,0,0.10));
  border: 1px solid var(--glass-bd); transition: transform .2s;
}
.game-card:hover { transform: translateY(-3px) scale(1.02); }
.game-card__icon { font-size: 36px; }
.game-card strong { font-size: 14px; }
.game-card small { font-size: 11px; color: var(--text-mute); }

/* ---------- LEADERBOARD ---------- */
.lb__podium { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; align-items: end; }
.podium {
  padding: 16px 8px; border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--glass-bg); border: 1px solid var(--glass-bd);
  text-align: center;
}
.podium--1 { padding-top: 28px; padding-bottom: 28px; border-color: var(--gold); box-shadow: var(--glow-gold); }
.podium--2 { padding-top: 16px; padding-bottom: 22px; border-color: #c0c0c0; }
.podium--3 { padding-top: 12px; padding-bottom: 18px; border-color: #cd7f32; }
.podium__rank { font-size: 28px; }
.podium__avatar { width: 48px; height: 48px; border-radius: 50%; margin: 6px auto; }
.podium__name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__score { font-size: 12px; color: var(--gold); margin-top: 2px; }

.lb__list { display: flex; flex-direction: column; gap: 6px; }
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--glass-bg); border: 1px solid var(--glass-bd); border-radius: var(--r-md);
}
.lb-row__rank { width: 32px; text-align: center; font-weight: 800; color: var(--text-dim); }
.lb-row__avatar { width: 36px; height: 36px; border-radius: 50%; }
.lb-row__meta { flex: 1; min-width: 0; }
.lb-row__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row__country { font-size: 11px; color: var(--text-mute); }
.lb-row__score { font-weight: 800; color: var(--gold); font-size: 14px; font-variant-numeric: tabular-nums; }
.lb-row.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }

/* ---------- WHITEPAPER PREVIEW ---------- */
.wp__hero { padding: 28px; border-radius: var(--r-lg); text-align: center; }
.wp__hero h2 { font-size: 22px; margin-bottom: 8px; }
.wp__hero p { font-size: 13px; color: var(--text-dim); }
.wp__links { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.wp__quick { padding: 18px; border-radius: var(--r-lg); }
.wp__quick h3 { font-size: 15px; margin-bottom: 10px; }
.wp__quick-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.wp__quick-list li { font-size: 13px; color: var(--text-dim); padding: 8px 12px; background: rgba(0,0,0,0.25); border-radius: var(--r-sm); }
.wp__quick-list li strong { color: var(--gold); }

/* ---------- MODALS ---------- */
.modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); animation: fadeIn .25s; }
.modal__panel {
  position: relative; z-index: 1; width: 100%; max-width: 380px;
  padding: 28px 20px; border-radius: var(--r-xl); text-align: center;
  animation: modalIn .4s var(--ease-out);
}
@keyframes modalIn { from { transform: scale(0.9) translateY(20px); opacity: 0; } }
.modal__close {
  position: absolute; top: 12px; right: 14px; font-size: 26px; line-height: 1;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,0.05); color: var(--text-dim);
}
.modal__close:hover { background: rgba(255,110,199,0.2); color: var(--neon-pink); }
.modal__hint { font-size: 12px; color: var(--text-mute); margin-top: 10px; }
.modal h3 { font-size: 18px; margin-bottom: 16px; }

.qr-canvas { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: var(--r-md); margin: 0 auto 12px; width: 240px; height: 240px; }
.qr-canvas canvas, .qr-canvas img { width: 216px; height: 216px; }

/* Spin wheel */
.spin__wrap { position: relative; width: 320px; height: 320px; margin: 0 auto 16px; }
.spin__wrap canvas { width: 100%; height: 100%; }
.spin__pointer {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  font-size: 32px; color: var(--gold); filter: drop-shadow(0 0 6px var(--gold));
  z-index: 2;
}

/* Lucky box */
.lucky__box {
  font-size: 100px; margin: 16px auto;
  animation: bob 1s var(--ease-in-out) infinite;
  transition: transform .3s;
}
.lucky__box.open { animation: shake .5s, pop .5s; }
@keyframes shake { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes pop { 50% { transform: scale(1.3); } }

/* Banned */
.banned__icon { font-size: 60px; margin-bottom: 8px; }

/* ---------- OFFLINE ---------- */
.offline { display: grid; place-items: center; min-height: 100dvh; padding: 30px; text-align: center; }
.offline__wrap { max-width: 360px; }
.offline__logo { font-size: 64px; animation: bob 2s infinite; }
.offline h1 { margin: 14px 0 8px; font-size: 24px; }
.offline p { color: var(--text-dim); font-size: 14px; margin-bottom: 18px; }

/* ---------- RESPONSIVE ---------- */
@media (min-width: 768px) {
  :root { --maxw: 880px; }
  .dash__grid, .ref__stats { grid-template-columns: repeat(4, 1fr); }
  .missions__fun-grid { grid-template-columns: 1fr 1fr 1fr; }
  .topbar__menu { display: none; }
  .sidenav { transform: translateX(0); }
  .sidenav__scrim { display: none; }
  .app-shell { padding-left: 280px; }
  .bottomnav { display: none; }
  .app-shell { padding-bottom: 24px; }
  .bn-link { display: none; }
}

@media (max-width: 360px) {
  .login__title { font-size: 30px; }
  .dash__name { font-size: 17px; }
  .claim__levels-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .claim-level { padding: 10px 4px; }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }


/* ================================================================
   PWA INSTALL BANNER
   ================================================================ */
.pwa-banner {
     position: fixed;
     bottom: -120px;
     left: 50%;
     transform: translateX(-50%);
     width: min(480px, calc(100% - 32px));
     background: linear-gradient(135deg, rgba(5,11,26,0.97) 0%, rgba(16,52,99,0.97) 100%);
     border: 1px solid rgba(78,192,255,0.30);
     border-radius: var(--r-lg);
     box-shadow: 0 -4px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(78,192,255,0.08);
     backdrop-filter: blur(20px);
     display: flex;
     align-items: center;
     gap: 12px;
     padding: 14px 16px;
     z-index: 9999;
     transition: bottom 0.4s cubic-bezier(0.34,1.56,0.64,1);
   }
.pwa-banner--visible { bottom: 24px; }
.pwa-banner__icon {
     width: 44px; height: 44px;
     border-radius: 10px;
     flex-shrink: 0;
   }
.pwa-banner__text {
     flex: 1;
     display: flex;
     flex-direction: column;
     gap: 2px;
   }
.pwa-banner__text strong {
     color: var(--gold);
     font-size: 14px;
     font-weight: 700;
   }
.pwa-banner__text span {
     color: var(--text-dim);
     font-size: 12px;
   }
.pwa-banner__install {
     background: linear-gradient(135deg, var(--nile), var(--nile-deep));
     color: #fff;
     border: none;
     border-radius: var(--r-md);
     padding: 8px 18px;
     font-size: 13px;
     font-weight: 700;
     cursor: pointer;
     white-space: nowrap;
     transition: opacity 0.2s;
     flex-shrink: 0;
   }
.pwa-banner__install:hover { opacity: 0.85; }
.pwa-banner__dismiss {
     background: transparent;
     border: none;
     color: var(--text-mute);
     font-size: 18px;
     cursor: pointer;
     padding: 4px 8px;
     line-height: 1;
     flex-shrink: 0;
     transition: color 0.2s;
   }
.pwa-banner__dismiss:hover { color: var(--text); }

/* ============================================================
   LANGUAGE SWITCHER (login screen pills + topbar button)
   ============================================================ */
.login__lang {
  display: flex; gap: 8px; justify-content: center;
  margin-bottom: 14px;
}
.lang-pill {
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-bd);
  color: var(--text-dim);
  font-size: 13px; font-weight: 700;
  transition: all .2s var(--ease-out);
  cursor: pointer;
}
.lang-pill:hover { color: var(--gold); border-color: var(--gold); }
.lang-pill.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1306; border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

.topbar__actions {
  display: flex; align-items: center; gap: 8px;
}
.topbar__lang {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-bd);
  color: var(--text);
  font-size: 12px; font-weight: 800;
  transition: all .2s var(--ease-out);
  cursor: pointer;
}
.topbar__lang:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1306; border-color: var(--gold);
  transform: scale(1.05);
}

/* Arabic typography: ensure Arabic text uses a proper font stack. */
html[lang="ar"] body {
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Cairo",
               "Helvetica Neue", Arial, sans-serif;
}
html[lang="ar"] .login__title,
html[lang="ar"] .topbar__name,
html[lang="ar"] .preloader__title {
  letter-spacing: 0;
  font-family: "Cairo", "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
}

/* ============================================================
   RTL (Right-to-Left) LAYOUT OVERRIDES
   Triggered automatically when <html dir="rtl"> is set by i18n.js
   ============================================================ */
html[dir="rtl"] body { text-align: right; }

/* Top bar: menu button goes on the right, balance on the left */
html[dir="rtl"] .topbar { flex-direction: row-reverse; }

/* Side nav slides in from the right instead of the left */
html[dir="rtl"] .sidenav {
  left: auto; right: 0;
  transform: translateX(100%);
  border-left: 1px solid var(--glass-bd);
  border-right: 0;
}
html[dir="rtl"] .sidenav.open { transform: translateX(0); }

/* Desktop sidenav takes space on the right */
@media (min-width: 768px) {
  html[dir="rtl"] .app-shell { padding-left: 0; padding-right: 280px; }
  html[dir="rtl"] .sidenav { transform: translateX(0); }
}

/* Dashboard hero: keep avatar+name on the right in RTL */
html[dir="rtl"] .dash__hero { flex-direction: row-reverse; }
html[dir="rtl"] .dash__hero-r { align-items: flex-start; }

/* Referral card share row stays centered, but flex wrapping reverses naturally */

/* Referral tree rows */
html[dir="rtl"] .ref-row { flex-direction: row-reverse; }

/* Leaderboard rows */
html[dir="rtl"] .lb-row { flex-direction: row-reverse; }

/* Claim streak pill — icon-text order stays the same (emoji-first is fine) */

/* Mission cards */
html[dir="rtl"] .mission-card { flex-direction: row-reverse; }
html[dir="rtl"] .mission-card__body { text-align: right; }

/* Toasts stay centered; arrows and direction-agnostic icons unaffected */

/* Modals: close button on the left in RTL */
html[dir="rtl"] .modal__close { right: auto; left: 14px; }

/* Forms (referral inputs) — text-align right */
html[dir="rtl"] input { text-align: right; }

/* Tables (whitepaper already has its own RTL via dir attribute on the page) */

/* Spinner pointer on the spin wheel: stays at top, no horizontal flip needed */

/* Off-canvas menu icon: lines stay the same; the menu slides from the right */

/* Spin pointer ▼ */
html[dir="rtl"] .spin__pointer { transform: scaleX(-1); }

/* Number formatting in Arabic locale uses Western Arabic numerals by default
   with toLocaleString("ar-EG"), but our locale call falls back gracefully. */

/* Margin / padding mirroring for asymmetric spacings */
html[dir="rtl"] .lf { text-align: right; }
html[dir="rtl"] .nav-link { flex-direction: row-reverse; }
html[dir="rtl"] .nav-link__icon { transform: scaleX(1); /* emoji already RTL-neutral */ }
html[dir="rtl"] .nav-link__label { text-align: right; }

/* PWA banner position unaffected (centered) */

