/* ============================================================
   COINMINER APP - Multi-Theme Mobile UI v2.0
   Themes: default | ramadan | ocean | gold | neon
   ============================================================ */

/* ── DEFAULT THEME ── */
:root,
[data-theme="default"] {
  --bg: #0A0E1A;
  --bg2: #0F1526;
  --card: #141B2D;
  --card2: #1A2238;
  --border: #1E2A45;
  --gold: #FFD700;
  --gold2: #FFA500;
  --blue: #00D4FF;
  --purple: #A78BFA;
  --green: #10B981;
  --red: #EF4444;
  --text: #E2E8F0;
  --text2: #94A3B8;
  --text3: #64748B;
  --accent: #FFD700;
  --accent2: #FFA500;
  --nav-bg: #0F1526;
  --nav-border: #1E2A45;
  --btn-primary: linear-gradient(135deg, #FFD700, #FFA500);
  --btn-text: #0A0E1A;
  --mine-btn-from: #FFE566;
  --mine-btn-to: #CC8800;
  --nav-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── RAMADAN THEME ── */
[data-theme="ramadan"] {
  --bg: #0D0A1A;
  --bg2: #120E22;
  --card: #1A1330;
  --card2: #221A3E;
  --border: #2D2050;
  --gold: #C9A227;
  --gold2: #E8B84B;
  --blue: #7B61FF;
  --purple: #9D4EDD;
  --green: #2DC653;
  --red: #E63946;
  --text: #F0EAF8;
  --text2: #B8A9D8;
  --text3: #7B6BA0;
  --accent: #C9A227;
  --accent2: #9D4EDD;
  --nav-bg: #120E22;
  --nav-border: #2D2050;
  --btn-primary: linear-gradient(135deg, #9D4EDD, #7B61FF);
  --btn-text: #fff;
  --mine-btn-from: #D4A8FF;
  --mine-btn-to: #7B2FBE;
}

/* ── OCEAN THEME ── */
[data-theme="ocean"] {
  --bg: #020B18;
  --bg2: #051525;
  --card: #081E35;
  --card2: #0C2845;
  --border: #103355;
  --gold: #00E5FF;
  --gold2: #0097A7;
  --blue: #00B4D8;
  --purple: #48CAE4;
  --green: #2EC4B6;
  --red: #FF6B6B;
  --text: #CAF0F8;
  --text2: #90E0EF;
  --text3: #48CAE4;
  --accent: #00E5FF;
  --accent2: #0097A7;
  --nav-bg: #051525;
  --nav-border: #103355;
  --btn-primary: linear-gradient(135deg, #00B4D8, #0096C7);
  --btn-text: #020B18;
  --mine-btn-from: #48CAE4;
  --mine-btn-to: #0077B6;
}

/* ── GOLD THEME ── */
[data-theme="gold"] {
  --bg: #13100A;
  --bg2: #1C1710;
  --card: #251E14;
  --card2: #2E2618;
  --border: #3D3220;
  --gold: #F4C542;
  --gold2: #E8A917;
  --blue: #FFC966;
  --purple: #FFB347;
  --green: #7BC67E;
  --red: #FF6B6B;
  --text: #FBF0D9;
  --text2: #D4B896;
  --text3: #8C7355;
  --accent: #F4C542;
  --accent2: #E8A917;
  --nav-bg: #1C1710;
  --nav-border: #3D3220;
  --btn-primary: linear-gradient(135deg, #F4C542, #E8A917);
  --btn-text: #13100A;
  --mine-btn-from: #FFE08A;
  --mine-btn-to: #B8860B;
}

/* ── NEON THEME ── */
[data-theme="neon"] {
  --bg: #050510;
  --bg2: #0A0A1E;
  --card: #0F0F28;
  --card2: #141432;
  --border: #1E1E46;
  --gold: #00FF94;
  --gold2: #00CC77;
  --blue: #00CFFF;
  --purple: #BF00FF;
  --green: #00FF94;
  --red: #FF0055;
  --text: #E0E0FF;
  --text2: #9090CC;
  --text3: #5050AA;
  --accent: #00FF94;
  --accent2: #00CFFF;
  --nav-bg: #0A0A1E;
  --nav-border: #1E1E46;
  --btn-primary: linear-gradient(135deg, #00FF94, #00CFFF);
  --btn-text: #050510;
  --mine-btn-from: #00FF94;
  --mine-btn-to: #0055CC;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── THEME TRANSITION ── */
body, .card, .balance-card, .bottom-nav, .modal-box, .task-item,
.invest-plan-card, .hagbad-card, .contract-card {
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

/* ── NOT IN TELEGRAM ── */
#tg-required {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; text-align: center;
}
.tg-required-inner {
  padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.tg-required-inner svg { width: 72px; height: 72px; }
.tg-required-inner h2 { font-size: 22px; color: var(--text); }
.tg-required-inner p { color: var(--text2); font-size: 15px; }
.tg-required-inner a {
  display: inline-block; padding: 12px 28px;
  background: #229ED9; color: #fff;
  border-radius: 12px; text-decoration: none; font-weight: 600;
}

/* ── LOADING ── */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; transition: opacity 0.4s;
}
.loading-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.loading-logo svg { width: 80px; height: 80px; animation: pulse 1.5s ease-in-out infinite; }
.loading-text { font-size: 24px; font-weight: 700; color: var(--gold); letter-spacing: 2px; }
.loading-status { font-size: 12px; color: var(--text3); margin-top: -4px; min-height: 18px; }
.loading-bar { width: 200px; height: 4px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 4px;
  animation: loading 3s ease-out forwards;
}
@keyframes loading { 0% { width: 0%; } 70% { width: 75%; } 90% { width: 90%; } 100% { width: 100%; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.05); opacity: 0.8; } }

/* ── APP SHELL ── */
#app { min-height: 100vh; padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px); }
.tab-content { display: none; padding: 0 0 16px; animation: fadeIn 0.2s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── HOME HEADER ── */
.home-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
}
.home-user { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; background: var(--card2); }
.user-name { font-size: 15px; font-weight: 600; color: var(--text); }
.user-streak { font-size: 12px; color: var(--gold); }
.notif-btn {
  position: relative; background: var(--card); border: none; border-radius: 10px;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2);
}
.notif-btn svg { width: 18px; height: 18px; }
.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── BALANCE CARD ── */
.balance-card {
  margin: 0 16px 14px;
  background: linear-gradient(135deg, var(--card2), var(--card));
  border: 1px solid var(--border);
  border-radius: 20px; padding: 20px; text-align: center;
  position: relative; overflow: hidden;
}
.balance-card::before {
  content: ''; position: absolute; top: -50%; left: -20%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,215,0,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.balance-label { font-size: 12px; color: var(--text2); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.balance-amount {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 32px; font-weight: 800; color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.3);
}
.coin-icon-sm { width: 28px; height: 28px; }
.boost-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,215,0,0.15); border: 1px solid rgba(255,215,0,0.3);
  border-radius: 20px; padding: 4px 12px; margin-top: 8px;
  font-size: 12px; color: var(--gold);
}

/* ── ENERGY ── */
.energy-section { padding: 0 16px 12px; }
.energy-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.energy-label { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--blue); }
.energy-text { font-size: 13px; color: var(--text2); }
.energy-bar { height: 8px; background: var(--card2); border-radius: 8px; overflow: hidden; }
.energy-fill {
  height: 100%;
  background: linear-gradient(90deg, #0066FF, var(--blue));
  border-radius: 8px; transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(0,212,255,0.5);
}
.energy-regen { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ── MINE BUTTON ── */
.mine-container {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 16px 8px; position: relative;
}
.mine-btn {
  width: 180px; height: 180px; border-radius: 50%; border: none;
  background: none; cursor: pointer; position: relative;
  transition: transform 0.1s; -webkit-user-select: none; user-select: none;
}
.mine-btn:active, .mine-btn.tapping { transform: scale(0.93); }
.mine-btn-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--mine-btn-from), var(--mine-btn-to));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px rgba(255,215,0,0.3), 0 8px 24px rgba(0,0,0,0.4),
              inset 0 2px 8px rgba(255,255,255,0.2);
  border: 3px solid var(--gold);
}
.mine-coin { width: 120px; height: 120px; }
.mine-tap-hint { font-size: 12px; color: var(--text2); margin-top: 8px; letter-spacing: 2px; text-transform: uppercase; }
.tap-floats { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.tap-float {
  position: absolute; font-size: 18px; font-weight: 800;
  color: var(--gold); animation: floatUp 0.8s ease-out forwards;
  pointer-events: none; user-select: none;
}
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-60px) scale(0.8); } }

/* ── SECTION CARDS ── */
.section-card {
  margin: 0 16px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 16px;
}
.section-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ── EARN GRID ── */
.earn-more-section { margin: 0 16px 14px; }
.earn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.earn-card {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; color: var(--text); font-weight: 600; font-size: 13px;
  transition: border-color 0.2s, background 0.2s;
}
.earn-card:active { background: var(--card); border-color: var(--gold); }
.earn-card svg { width: 28px; height: 28px; color: var(--accent); }
.earn-card small { color: var(--text3); font-size: 11px; }

/* ── PAGE HEADER ── */
.page-header { padding: 20px 16px 12px; }
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--text); }
.page-header p { color: var(--text2); font-size: 13px; margin-top: 4px; }

/* ── TASKS ── */
.task-tabs { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; }
.task-tab {
  padding: 7px 16px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--card); color: var(--text2); font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
}
.task-tab.active { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }
.tasks-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.task-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
  display: flex; align-items: center; gap: 12px;
}
.task-item.completed { opacity: 0.6; }
.task-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.task-icon svg { width: 26px; height: 26px; }
.task-icon.youtube { background: rgba(255,0,0,0.1); }
.task-icon.facebook { background: rgba(24,119,242,0.1); }
.task-icon.telegram { background: rgba(34,158,217,0.1); }
.task-icon.globe { background: rgba(16,185,129,0.1); }
.task-icon.calendar { background: rgba(167,139,250,0.1); }
.task-icon.play { background: rgba(255,215,0,0.1); }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 600; color: var(--text); }
.task-reward { font-size: 12px; color: var(--gold); margin-top: 2px; }
.task-timer { font-size: 11px; color: var(--text3); margin-top: 2px; }
.task-action-btn {
  padding: 8px 16px; border-radius: 10px; border: none;
  background: var(--btn-primary); color: var(--btn-text);
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.task-action-btn.done { background: var(--card2); color: var(--text3); cursor: default; }

/* ── CHALLENGES ── */
.challenge-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.challenge-tab {
  padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--card2); color: var(--text2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.challenge-tab.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.challenge-item { margin-bottom: 12px; padding: 12px; background: var(--card2); border-radius: 12px; }
.challenge-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.challenge-title { font-size: 13px; font-weight: 600; color: var(--text); }
.challenge-reward { font-size: 13px; color: var(--gold); font-weight: 700; }
.challenge-progress-bar { height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.challenge-progress-fill { height: 100%; background: var(--btn-primary); border-radius: 6px; transition: width 0.5s ease; }
.challenge-footer { display: flex; justify-content: space-between; align-items: center; }
.challenge-progress-text { font-size: 11px; color: var(--text3); }
.claim-btn {
  padding: 5px 14px; border-radius: 8px; border: none;
  background: var(--green); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer;
}
.claim-btn:disabled { background: var(--card); color: var(--text3); cursor: default; }

/* ── INVEST ── */
.invest-nav-tabs { display: flex; overflow-x: auto; gap: 8px; padding: 0 16px 12px; }
.inv-tab {
  padding: 7px 16px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--card); color: var(--text2); font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
}
.inv-tab.active { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }
.invest-info-card {
  margin: 0 16px 12px; padding: 12px 14px;
  background: rgba(255,215,0,0.06); border: 1px solid rgba(255,215,0,0.15);
  border-radius: 12px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text2);
}
.invest-plans-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.invest-plan-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.invest-plan-logo {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--card2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.invest-plan-info { flex: 1; }
.invest-plan-name { font-size: 14px; font-weight: 700; color: var(--text); }
.invest-plan-dur { font-size: 12px; color: var(--text2); margin-top: 2px; }
.invest-plan-roi { font-size: 14px; font-weight: 700; text-align: right; }
.invest-plan-roi small { display: block; font-size: 10px; color: var(--text3); font-weight: 400; }
.contract-card {
  margin: 0 16px 12px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
}
.contract-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.contract-name { font-size: 15px; font-weight: 700; color: var(--text); }
.contract-status { padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.contract-status.active { background: rgba(16,185,129,0.15); color: var(--green); }
.contract-status.completed { background: rgba(167,139,250,0.15); color: var(--purple); }
.contract-info { font-size: 13px; color: var(--text2); line-height: 1.6; }
.contract-countdown { font-size: 12px; color: var(--blue); margin-top: 8px; font-weight: 600; }

/* ── HAGBAD ── */
.hagbad-info { margin: 0 16px 12px; padding: 14px; background: var(--card); border-radius: 12px; border: 1px solid var(--border); }
.hagbad-info h3 { font-size: 16px; color: var(--purple); margin-bottom: 6px; }
.hagbad-info p { font-size: 13px; color: var(--text2); line-height: 1.5; }
.hagbad-list { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.hagbad-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.hagbad-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.hagbad-name { font-size: 15px; font-weight: 700; color: var(--text); }
.hagbad-status { padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.hagbad-status.open { background: rgba(16,185,129,0.15); color: var(--green); }
.hagbad-status.active { background: rgba(0,212,255,0.15); color: var(--blue); }
.hagbad-status.completed { background: rgba(167,139,250,0.15); color: var(--purple); }
.hagbad-details { font-size: 13px; color: var(--text2); line-height: 1.7; margin-bottom: 10px; }
.hagbad-members-bar { height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.hagbad-members-fill { height: 100%; background: var(--green); border-radius: 6px; transition: width 0.5s; }

/* ── REFERRAL ── */
.referral-hero { padding: 0 16px 14px; }
.referral-stats { display: flex; gap: 12px; }
.ref-stat {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; text-align: center;
}
.ref-stat-value { font-size: 20px; font-weight: 800; color: var(--gold); }
.ref-stat-label { font-size: 11px; color: var(--text2); margin-top: 4px; }
.ref-link-card {
  margin: 0 16px 14px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px;
}
.ref-link-label { font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.ref-link-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.ref-link-text {
  flex: 1; background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  font-size: 12px; color: var(--blue); word-break: break-all;
}
.copy-btn {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); flex-shrink: 0;
}
.copy-btn svg { width: 18px; height: 18px; }
.share-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.share-btn svg { width: 18px; height: 18px; }

/* ── LEADERBOARD ── */
.lb-period-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.lb-tab {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--card2); color: var(--text2); font-size: 12px; font-weight: 600; cursor: pointer;
}
.lb-tab.active { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }
.lb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.lb-item:last-child { border-bottom: none; }
.lb-rank {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--card2); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--text2); flex-shrink: 0;
}
.lb-rank.gold { background: rgba(255,215,0,0.2); color: #FFD700; }
.lb-rank.silver { background: rgba(192,192,192,0.2); color: #C0C0C0; }
.lb-rank.bronze { background: rgba(205,127,50,0.2); color: #CD7F32; }
.lb-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--card2); }
.lb-name { flex: 1; font-size: 14px; color: var(--text); font-weight: 600; }
.lb-score { font-size: 14px; color: var(--gold); font-weight: 700; }

/* ── LEAGUE LEADERBOARD ── */
.league-banner {
  margin: 0 16px 14px; padding: 16px;
  background: linear-gradient(135deg, var(--card2), var(--card));
  border: 2px solid var(--accent); border-radius: 20px; text-align: center;
}
.league-banner-title { font-size: 18px; font-weight: 800; color: var(--accent); }
.league-timer { font-size: 13px; color: var(--text2); margin-top: 4px; }
.league-prizes { display: flex; gap: 8px; margin-top: 12px; }
.league-prize {
  flex: 1; background: var(--bg2); border-radius: 10px; padding: 10px;
  text-align: center; border: 1px solid var(--border);
}
.league-prize-rank { font-size: 18px; margin-bottom: 4px; }
.league-prize-coins { font-size: 12px; font-weight: 700; color: var(--gold); }
.lb-you { background: rgba(255,215,0,0.06) !important; border: 1px solid rgba(255,215,0,0.2) !important; border-radius: 10px; }

/* ── PROFILE ── */
.profile-header { padding: 24px 16px 16px; text-align: center; }
.profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 12px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--gold); object-fit: cover; background: var(--card2); }
.profile-level {
  position: absolute; bottom: -4px; right: -4px;
  background: var(--gold); color: #000; font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 10px;
}
.profile-name { font-size: 18px; font-weight: 800; color: var(--text); }
.profile-username { font-size: 13px; color: var(--text2); margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; margin-bottom: 14px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; text-align: center;
}
.stat-card svg { margin-bottom: 6px; }
.stat-value { font-size: 18px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text2); margin-top: 4px; }

/* ── WALLET ── */
.wallet-info { font-size: 13px; color: var(--text2); line-height: 1.7; margin-bottom: 12px; }
.tx-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tx-item:last-child { border-bottom: none; }
.tx-note { font-size: 13px; color: var(--text); }
.tx-amount { font-size: 14px; font-weight: 700; }
.tx-item.credit .tx-amount { color: var(--green); }
.tx-item.debit .tx-amount { color: var(--red); }

/* ── NOTIFICATIONS ── */
.notif-item {
  padding: 12px; border-radius: 12px;
  background: var(--card2); margin-bottom: 8px; cursor: pointer;
}
.notif-item.reward { border-left: 3px solid var(--gold); }
.notif-item.success { border-left: 3px solid var(--green); }
.notif-item.info { border-left: 3px solid var(--blue); }
.notif-item.league { border-left: 3px solid var(--purple); }
.notif-item.ramadan { border-left: 3px solid var(--accent2); }
.notif-item.podcast { border-left: 3px solid var(--blue); }
.notif-title { font-size: 14px; font-weight: 700; color: var(--text); }
.notif-message { font-size: 12px; color: var(--text2); margin-top: 4px; line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 6px; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--nav-bg); border-top: 1px solid var(--nav-border);
  display: flex; height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  z-index: 100;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; border: none; background: none;
  color: var(--text3); cursor: pointer; font-size: 10px;
  transition: color 0.2s;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active { color: var(--accent); }
.nav-btn span { font-weight: 600; }

/* ── MODALS ── */
.modal {
  position: fixed; inset: 0; display: flex; align-items: flex-end;
  justify-content: center; z-index: 1000;
}
.modal-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.modal-box {
  position: relative; background: var(--bg2); border-radius: 24px 24px 0 0;
  padding: 24px; width: 100%; max-height: 90vh; overflow-y: auto;
  border-top: 1px solid var(--border);
}
.modal-box h2 { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.modal-box p { font-size: 14px; color: var(--text2); margin-bottom: 16px; }

/* ── FORMS ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: 14px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent); outline: none;
}
.form-group textarea { resize: none; height: 80px; }
.form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394A3B8'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
option { background: var(--bg2); }
.invest-detail { background: var(--card); border-radius: 12px; padding: 14px; font-size: 13px; color: var(--text2); line-height: 1.7; margin-bottom: 14px; }
.invest-calc { margin-top: 8px; font-size: 13px; color: var(--text2); line-height: 1.6; }
.withdraw-info { background: var(--card); border-radius: 12px; padding: 14px; font-size: 13px; color: var(--text2); line-height: 1.7; margin-bottom: 14px; }

/* ── BUTTONS ── */
.btn-primary {
  width: 100%; padding: 14px; border: none; border-radius: 14px;
  background: var(--btn-primary); color: var(--btn-text);
  font-size: 15px; font-weight: 800; cursor: pointer; letter-spacing: 0.5px;
}
.btn-secondary {
  width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--card2); color: var(--text2);
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.btn-secondary:disabled { opacity: 0.5; cursor: default; }
.btn-primary-sm {
  padding: 7px 16px; border: none; border-radius: 10px;
  background: var(--btn-primary); color: var(--btn-text);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-link { background: none; border: none; color: var(--blue); font-size: 13px; cursor: pointer; }
.icon-btn { background: none; border: none; color: var(--text2); cursor: pointer; padding: 4px; }

/* ── SPIN ── */
.spin-box { text-align: center; }
.spin-wheel-container { position: relative; width: 240px; height: 240px; margin: 16px auto; }
.spin-wheel {
  width: 100%; height: 100%; border-radius: 50%;
  background: conic-gradient(
    #1A2238 0deg 45deg, #2A3A5A 45deg 90deg,
    #1A2238 90deg 135deg, #2A3A5A 135deg 180deg,
    #1A2238 180deg 225deg, #2A3A5A 225deg 270deg,
    #1A2238 270deg 315deg, #2A3A5A 315deg 360deg
  );
  border: 4px solid var(--gold); transition: transform 3s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  display: flex; align-items: center; justify-content: center;
}
.spin-segments { display: none; }
.spin-arrow {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 20px solid var(--gold);
}
.spin-result { margin-top: 16px; font-size: 16px; font-weight: 700; min-height: 24px; }
.spin-result.win { color: var(--green); }
.spin-result.loss { color: var(--text2); }

/* ── SCRATCH ── */
.scratch-box { text-align: center; }
#scratch-card { position: relative; width: 240px; height: 120px; margin: 16px auto; border-radius: 12px; overflow: hidden; }
#scratch-canvas { position: absolute; inset: 0; cursor: crosshair; border-radius: 12px; }
#scratch-result {
  width: 240px; height: 120px; background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
}

/* ── VIDEO ── */
.video-box { padding: 0; overflow: hidden; border-radius: 24px 24px 0 0; }
.video-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
}
.video-header span { font-size: 16px; font-weight: 700; color: var(--text); }
#video-container { width: 100%; aspect-ratio: 16/9; background: #000; }
#video-iframe { width: 100%; height: 100%; border: none; }
.video-footer { padding: 16px; }
.video-progress-bar { height: 4px; background: var(--card2); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
#video-progress-fill { height: 100%; background: var(--gold); width: 0%; transition: width 1s linear; }
#video-timer { font-size: 12px; color: var(--text2); margin-bottom: 12px; }

/* ── AD SLOTS ── */
.ad-slot { margin: 0 16px; }
.ad-banner { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; color: var(--text2); font-size: 13px; }
.ad-native { background: var(--card2); border-radius: 12px; padding: 12px; color: var(--text2); font-size: 13px; }

/* ── RAMADAN STREAM PLAYER ── */
.ramadan-stream {
  margin: 0 16px 14px; padding: 16px;
  background: linear-gradient(135deg, #1A1330, #221A3E);
  border: 2px solid #C9A227; border-radius: 20px;
}
.ramadan-stream-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.ramadan-stream-title { font-size: 15px; font-weight: 700; color: #C9A227; flex: 1; }
.ramadan-live-badge {
  background: #E63946; color: #fff; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 6px; letter-spacing: 1px;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.ramadan-audio-bar {
  display: flex; align-items: center; gap: 12px;
  background: rgba(201,162,39,0.1); border-radius: 12px; padding: 12px;
}
.ramadan-audio-icon { font-size: 28px; }
.ramadan-audio-info { flex: 1; }
.ramadan-audio-name { font-size: 13px; font-weight: 600; color: #F0EAF8; }
.ramadan-audio-sub { font-size: 11px; color: #B8A9D8; margin-top: 2px; }
.ramadan-waves {
  display: flex; align-items: flex-end; gap: 3px; height: 24px;
}
.ramadan-wave {
  width: 3px; background: #C9A227; border-radius: 3px;
  animation: wave 0.8s ease-in-out infinite alternate;
}
.ramadan-wave:nth-child(2) { animation-delay: 0.1s; height: 60%; }
.ramadan-wave:nth-child(3) { animation-delay: 0.2s; height: 90%; }
.ramadan-wave:nth-child(4) { animation-delay: 0.3s; height: 50%; }
.ramadan-wave:nth-child(5) { animation-delay: 0.4s; height: 80%; }
@keyframes wave { from { height: 20%; } to { height: 100%; } }

/* ── MINI CONTRACT ── */
.mini-contract { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mini-contract:last-child { border-bottom: none; }
.mini-contract-name { font-size: 13px; font-weight: 600; color: var(--text); }
.mini-contract-countdown { font-size: 11px; color: var(--text2); margin-top: 2px; }
.mini-contract-return { font-size: 13px; color: var(--green); font-weight: 700; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  opacity: 0; transition: all 0.3s ease; z-index: 2000; pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }

/* ── POPUP (League winners, notifications) ── */
.popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.popup-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 24px; padding: 24px; margin: 20px;
  max-width: 340px; width: 100%; text-align: center; position: relative;
}
.popup-box h2 { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
.popup-box p { font-size: 14px; color: var(--text2); line-height: 1.6; margin-bottom: 16px; }
.popup-winners { margin: 16px 0; }
.popup-winner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--card); border-radius: 12px; margin-bottom: 8px;
}
.popup-winner-rank { font-size: 22px; }
.popup-winner-info { flex: 1; text-align: left; }
.popup-winner-name { font-size: 14px; font-weight: 700; color: var(--text); }
.popup-winner-coins { font-size: 12px; color: var(--gold); }
.popup-close { background: var(--btn-primary); color: var(--btn-text); border: none; border-radius: 12px; padding: 12px 32px; font-size: 15px; font-weight: 800; cursor: pointer; }

/* ── PODCAST ── */
.podcast-player {
  margin: 0 16px 14px; padding: 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
}
.podcast-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.podcast-icon { font-size: 28px; }
.podcast-title { font-size: 15px; font-weight: 700; color: var(--text); }
.podcast-sub { font-size: 12px; color: var(--text2); }

/* ── HIJRI DATE ── */
.hijri-date {
  text-align: center; padding: 8px 16px 4px;
  font-size: 13px; color: var(--accent2); font-weight: 600;
}

/* ── SCROLL BARS ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ============================================================
   v3.0 ADDITIONS: Challenge Pool, Badges, Ramadan Frame
   ============================================================ */

/* ── RAMADAN FRAME ── */
.ramadan-frame-wrap {
  position: relative;
  display: inline-block;
}
.ramadan-frame-wrap::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(#C9A227, #9D4EDD, #2DC653, #C9A227);
  z-index: 0;
  animation: frameRotate 3s linear infinite;
}
.ramadan-frame-wrap .profile-avatar {
  position: relative;
  z-index: 1;
  border: 3px solid var(--bg);
}
@keyframes frameRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Ramadan crescent decorations */
[data-theme="ramadan"] .balance-card::before {
  content: '';
  position: absolute;
  top: 8px; right: 12px;
  width: 32px; height: 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 4a12 12 0 1 0 0 24A9 9 0 1 1 16 4z' fill='%23C9A22744'/%3E%3C/svg%3E") no-repeat center/contain;
  pointer-events: none;
}
[data-theme="ramadan"] .page-header {
  background: linear-gradient(135deg, rgba(157,78,221,0.15), rgba(201,162,39,0.08));
  border-bottom: 1px solid rgba(201,162,39,0.2);
  padding: 20px 16px 16px;
  margin-bottom: 4px;
}
[data-theme="ramadan"] .page-header::after {
  content: '☪';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  opacity: 0.2;
  pointer-events: none;
}
.page-header { position: relative; }

/* Star field for Ramadan */
[data-theme="ramadan"] #app::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 10%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 5%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 25%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 15%, rgba(255,255,255,0.25) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── BADGE STYLES ── */
.badge-icon {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 4px;
}
.badge-influencer {
  background: linear-gradient(135deg, #FF8C00, #FFD700);
  color: #000;
}
.badge-verified {
  background: linear-gradient(135deg, #9D4EDD, #00D4FF);
  color: #fff;
}
.badge-influencer svg,
.badge-verified svg {
  width: 10px; height: 10px;
}

/* Badge in leaderboard/profile */
.lb-item .badge-icon,
.ref-user-badge .badge-icon {
  font-size: 9px;
  padding: 1px 5px;
}

/* Badge notification */
.notif-item.badge-notif {
  border-left: 3px solid #9D4EDD;
  background: linear-gradient(90deg, rgba(157,78,221,0.08), transparent);
}

/* ── CHALLENGE POOL ── */
.pool-section {
  margin: 0 0 16px;
}
.pool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}
[data-theme="ramadan"] .pool-card {
  border-color: rgba(201,162,39,0.3);
  background: linear-gradient(135deg, #1A1330, #221A3E);
}
.pool-card-header {
  padding: 14px 16px 10px;
  background: linear-gradient(135deg, rgba(201,162,39,0.12), rgba(157,78,221,0.08));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pool-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  flex: 1;
}
.pool-status {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.pool-status.active {
  background: rgba(16,185,129,0.15);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.3);
}
.pool-status.upcoming {
  background: rgba(0,212,255,0.1);
  color: var(--blue);
  border: 1px solid rgba(0,212,255,0.2);
}
.pool-body {
  padding: 14px 16px;
}
.pool-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pool-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text2);
}
.pool-meta-item svg { width: 14px; height: 14px; }
.pool-meta-item strong { color: var(--text); }

/* Prize breakdown */
.pool-prizes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.pool-prize-item {
  background: var(--bg2);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  border: 1px solid var(--border);
}
.pool-prize-rank {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 3px;
}
.pool-prize-rank svg { width: 18px; height: 18px; display: block; margin: 0 auto; }
.pool-prize-label {
  font-size: 9px;
  color: var(--text3);
  margin-bottom: 3px;
  font-weight: 600;
  text-transform: uppercase;
}
.pool-prize-amount {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
}

/* Pool leaderboard */
.pool-lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.pool-lb-row:last-child { border-bottom: none; }
.pool-lb-rank {
  width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
}
.pool-lb-rank.gold   { color: #FFD700; }
.pool-lb-rank.silver { color: #C0C0C0; }
.pool-lb-rank.bronze { color: #CD7F32; }
.pool-lb-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}
.pool-lb-score {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
}

/* My pool status */
.my-pool-status {
  background: rgba(201,162,39,0.08);
  border: 1px solid rgba(201,162,39,0.2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.my-pool-status svg { width: 18px; height: 18px; color: var(--gold); }
.my-pool-rank-text {
  font-size: 12px;
  color: var(--text2);
}
.my-pool-rank-text strong { color: var(--gold); }

.pool-join-btn {
  width: 100%;
  padding: 11px;
  background: var(--btn-primary);
  color: var(--btn-text);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.pool-join-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Pool timer */
.pool-timer {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  margin-top: 8px;
}
.pool-timer strong { color: var(--gold); }

/* ── REFERRAL PAGE BADGE DISPLAY ── */
.ref-badge-milestone {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}
.ref-badge-milestone-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-milestone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.badge-milestone-row:last-child { border-bottom: none; }
.badge-milestone-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge-milestone-label {
  font-size: 12px;
  color: var(--text2);
}
.badge-milestone-progress {
  font-size: 11px;
  color: var(--text3);
}

/* ── IMPROVED ICON STYLES (replacing emoji) ── */
.nav-btn svg { width: 22px; height: 22px; }

/* Pool nav tab */
.nav-btn[data-tab="pool"] { position: relative; }

/* ── POOL HOME WIDGET ── */
.pool-home-widget {
  background: linear-gradient(135deg, var(--card), var(--card2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 12px 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
[data-theme="ramadan"] .pool-home-widget {
  border-color: rgba(201,162,39,0.35);
  background: linear-gradient(135deg, rgba(157,78,221,0.1), rgba(201,162,39,0.06));
}
.pool-home-widget::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,162,39,0.05), transparent);
  pointer-events: none;
}
.pool-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pool-widget-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pool-widget-title svg { width: 16px; height: 16px; }
.pool-widget-live {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
}
.pool-widget-live-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.pool-widget-prizes {
  display: flex;
  gap: 8px;
}
.pool-widget-prize {
  background: var(--bg2);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
  flex: 1;
  border: 1px solid var(--border);
}
.pool-widget-prize-rank {
  font-size: 16px;
  margin-bottom: 2px;
}
.pool-widget-prize-rank svg { width: 16px; height: 16px; display: block; margin: 0 auto; }
.pool-widget-prize-amt {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
}
.pool-widget-footer {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text3);
  text-align: center;
}

/* ── NOTIF BADGE COLOURS ── */
.notif-item.pool-notif {
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, rgba(201,162,39,0.06), transparent);
}

/* ============================================================
   v4.0 UPDATES: Ramadan Lanterns, Nav Fix, ROSCA, Invest Header
   ============================================================ */

/* ── FONT OVERRIDE ── */
html, body {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── BOTTOM NAV FIX (5 tabs, no overflow) ── */
.bottom-nav {
  padding-left: 0;
  padding-right: 0;
}
.nav-btn {
  min-width: 0;
  padding: 0 2px;
  font-size: 9px;
}
.nav-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.nav-btn span {
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52px;
}

/* Invest tab accent color in nav */
.nav-btn.nav-btn-invest.active {
  color: var(--green);
}

/* ── RAMADAN LANTERNS (full width top decoration) ── */
.ramadan-lanterns {
  width: 100%;
  overflow: hidden;
  pointer-events: none;
  height: 110px;
  position: relative;
}
.ramadan-lanterns .lantern-svg {
  width: 100%;
  height: 110px;
}
.lantern-anim {
  animation: lanternSway 3s ease-in-out infinite alternate;
  transform-origin: center top;
}
.lantern-anim:nth-child(2) { animation-delay: 0.5s; }
.lantern-anim:nth-child(3) { animation-delay: 1s; }
@keyframes lanternSway {
  from { transform: rotate(-4deg); }
  to   { transform: rotate(4deg); }
}
/* Glow effect on lanterns in ramadan theme */
[data-theme="ramadan"] .ramadan-lanterns {
  display: block !important;
}

/* ── HOME RAMADAN LANTERNS ── */
.home-ramadan-lanterns {
  width: 100%;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(13,10,26,0) 0%, var(--bg) 100%);
  position: relative;
}

/* ── INVEST TAB RAMADAN HEADER ── */
.invest-ramadan-header {
  background: linear-gradient(180deg, rgba(157,78,221,0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(201,162,39,0.15);
  padding-bottom: 0;
  margin-bottom: 4px;
  overflow: hidden;
}
.invest-lantern-frame {
  width: 100%;
  overflow: hidden;
}
.invest-header-text {
  padding: 8px 16px 16px;
}
.invest-header-text h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.invest-header-text p {
  color: var(--text2);
  font-size: 13px;
  margin-top: 4px;
}
/* In non-Ramadan theme, hide the lantern frame but show header */
:not([data-theme="ramadan"]) .invest-ramadan-header {
  background: none;
  border-bottom: none;
}
:not([data-theme="ramadan"]) .invest-lantern-frame {
  display: none;
}
:not([data-theme="ramadan"]) .invest-header-text {
  padding: 20px 16px 12px;
}

/* Ramadan theme lantern frame fully visible */
[data-theme="ramadan"] .invest-ramadan-header {
  background: linear-gradient(180deg, rgba(157,78,221,0.12) 0%, transparent 100%);
  border-bottom: 1px solid rgba(201,162,39,0.3);
}

/* ── INVEST TAB TABS ICON FIX ── */
.inv-tab {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── ROSCA HAGBAD DESIGN ── */
.hagbad-rosca-icon {
  font-size: 32px;
  text-align: center;
  margin-bottom: 8px;
}
.hagbad-info {
  text-align: center;
}
.hagbad-info h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--purple);
}
[data-theme="ramadan"] .hagbad-info {
  border: 1px solid rgba(157,78,221,0.3);
  background: linear-gradient(135deg, rgba(157,78,221,0.08), rgba(201,162,39,0.05));
}

/* ── REFERRAL USERS LIST ── */
.ref-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ref-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--card2);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.ref-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg2);
  border: 2px solid var(--border);
  object-fit: cover;
}
.ref-user-info {
  flex: 1;
}
.ref-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ref-user-date {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}
.ref-user-reward {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

/* ── CHALLENGES FIX (proper progress display) ── */
.challenge-item {
  padding: 14px;
  background: var(--card2);
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.challenge-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.challenge-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.challenge-reward {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
  white-space: nowrap;
}
.challenge-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.challenge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 8px;
  transition: width 0.6s ease;
  box-shadow: 0 0 6px rgba(255,215,0,0.4);
}
.challenge-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.challenge-progress-text {
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
}
.claim-btn {
  padding: 6px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--green), #059669);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.claim-btn:disabled {
  background: var(--card);
  color: var(--text3);
  cursor: default;
  opacity: 0.7;
}

/* Home challenge preview cards */
#home-challenges-list .challenge-item {
  padding: 12px;
}

/* ── RAMADAN SCHEDULED STREAM ── */
.ramadan-scheduled {
  font-size: 13px;
  color: var(--accent2);
  text-align: center;
  padding: 8px;
  margin-top: 8px;
}

/* ── IMPROVED COUNTRY SELECT ── */
#country-select option,
#country-select optgroup {
  font-size: 14px;
}
#country-select optgroup {
  font-weight: 700;
  color: var(--text2);
}

/* ── INVEST NAV TABS FIX ── */
.invest-nav-tabs {
  padding-bottom: 8px;
}
.inv-tab svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ── REFERRAL COUNT FIX ── */
#ref-total {
  font-size: 24px;
  font-weight: 900;
}

/* ── RAMADAN THEME ENHANCEMENTS ── */
[data-theme="ramadan"] .balance-card {
  background: linear-gradient(135deg, rgba(157,78,221,0.15), rgba(201,162,39,0.08));
  border-color: rgba(201,162,39,0.3);
}
[data-theme="ramadan"] .mine-btn-inner {
  box-shadow: 0 0 40px rgba(201,162,39,0.4), 0 8px 24px rgba(0,0,0,0.4);
  border-color: var(--gold2);
}
[data-theme="ramadan"] .earn-card:active {
  border-color: var(--gold2);
}
[data-theme="ramadan"] .section-card {
  border-color: rgba(201,162,39,0.15);
}
[data-theme="ramadan"] .bottom-nav {
  border-top-color: rgba(201,162,39,0.2);
}
[data-theme="ramadan"] .challenge-progress-fill {
  background: linear-gradient(90deg, #C9A227, #9D4EDD);
}

/* ── LANTERN GLOW ANIMATION ── */
@keyframes lanternGlow {
  0%, 100% { opacity: 0.85; filter: drop-shadow(0 0 6px rgba(201,162,39,0.6)); }
  50%       { opacity: 1;    filter: drop-shadow(0 0 12px rgba(201,162,39,0.9)); }
}
[data-theme="ramadan"] .invest-lantern-frame svg rect,
[data-theme="ramadan"] .invest-lantern-frame svg g {
  animation: lanternGlow 2s ease-in-out infinite;
}

/* ── PROFILE AVATAR WRAP (header user icon) ── */
#profile-avatar-wrap {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50%;
  overflow: visible;
}
#profile-avatar-wrap .user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
/* Big profile avatar */
#profile-avatar-wrap-big {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}
