/* CoinFun - Dark Gaming UI - Mobile First */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #0d0d1a;
  --bg-card: #151528;
  --bg-card2: #1a1a32;
  --bg-input: #0f0f22;
  --accent: #f7b731;
  --accent2: #7c3aed;
  --accent3: #10b981;
  --danger: #ef4444;
  --text-primary: #f1f1f5;
  --text-secondary: #8888aa;
  --text-muted: #555577;
  --border: rgba(255,255,255,0.06);
  --border-accent: rgba(247,183,49,0.3);
  --glow: rgba(247,183,49,0.15);
  --purple-glow: rgba(124,58,237,0.2);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  --nav-h: 72px;
  --top-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ────── Splash Screen (Hamster Kombat style) ────── */
.splash-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #05060f 0%, #0a0a1e 40%, #0d0d2a 100%);
  overflow: hidden;
}

/* Art / character area fills top ~65% */
.splash-art {
  position: relative; flex: 1;
  display: flex; align-items: flex-end; justify-content: center;
  min-height: 0;
}

/* Cosmic glowing orbs like the reference image */
.splash-orb {
  position: absolute; border-radius: 50%;
  filter: blur(60px); pointer-events: none;
}
.splash-orb-1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(124,58,237,0.55) 0%, transparent 70%);
  top: -80px; left: -60px;
  animation: orbPulse 4s ease-in-out infinite;
}
.splash-orb-2 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(59,130,246,0.45) 0%, transparent 70%);
  top: -40px; right: -40px;
  animation: orbPulse 5s ease-in-out infinite 1s;
}
.splash-orb-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(247,183,49,0.3) 0%, transparent 70%);
  bottom: 40px; left: -30px;
  animation: orbPulse 6s ease-in-out infinite 2s;
}
.splash-orb-4 {
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(16,185,129,0.25) 0%, transparent 70%);
  bottom: 20px; right: -20px;
  animation: orbPulse 4.5s ease-in-out infinite 0.5s;
}
@keyframes orbPulse { 0%,100%{opacity:0.7;transform:scale(1)} 50%{opacity:1;transform:scale(1.15)} }

/* Character SVG */
.splash-character {
  position: relative; z-index: 5;
  width: min(280px, 80vw);
  animation: characterFloat 3.5s ease-in-out infinite;
  filter: drop-shadow(0 20px 40px rgba(247,183,49,0.25))
          drop-shadow(0 0 60px rgba(124,58,237,0.2));
}
.splash-character svg { width: 100%; height: auto; display: block; }
@keyframes characterFloat {
  0%,100% { transform: translateY(0px) rotate(-0.5deg); }
  50%     { transform: translateY(-14px) rotate(0.5deg); }
}

/* Bottom section */
.splash-bottom {
  flex-shrink: 0;
  background: linear-gradient(to bottom, transparent, rgba(5,6,15,0.95) 20%, #05060f 60%);
  padding: 0 24px 32px;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
}

/* Spinner ring - exact style from reference image */
.splash-spinner-wrap {
  width: 52px; height: 52px; margin-bottom: 4px;
}
.splash-spinner {
  width: 52px; height: 52px;
  animation: spinnerRotate 1.1s linear infinite;
}
@keyframes spinnerRotate { to { transform: rotate(360deg); } }
.spinner-arc {
  transform-origin: 30px 30px;
  stroke: #f7b731;
  filter: drop-shadow(0 0 6px rgba(247,183,49,0.8));
}

.splash-loading-text {
  font-size: 15px; font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.splash-title {
  font-size: 38px; font-weight: 900;
  background: linear-gradient(135deg, #f7b731 0%, #ff9500 50%, #f7b731 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px; line-height: 1.1;
}

.splash-subtitle {
  font-size: 18px; font-weight: 700;
  color: #7c9ef7;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.splash-tagline {
  font-size: 14px; color: rgba(255,255,255,0.5);
  margin-bottom: 20px;
}

/* Social buttons - match the reference exactly */
.splash-social {
  display: flex; gap: 14px; align-items: center;
}
.splash-social-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.8); text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(10px);
}
.splash-social-btn svg { width: 22px; height: 22px; }
.splash-social-btn:active { background: rgba(255,255,255,0.16); transform: scale(0.92); }

/* ────── Telegram Gate ────── */
.tg-gate {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 30px;
  background: var(--bg-primary); z-index: 999;
}
.tg-gate-icon { width: 80px; height: 80px; margin: 0 auto 20px;
  border-radius: 50%; background: var(--bg-card2);
  display: flex; align-items: center; justify-content: center; }
.tg-gate-icon svg { width: 40px; height: 40px; stroke: var(--accent); }
.tg-gate h2 { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.tg-gate p { color: var(--text-secondary); line-height: 1.6; margin-bottom: 6px; }

/* ────── App Shell ────── */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.hidden { display: none !important; }

/* ────── Top Bar ────── */
.topbar {
  height: var(--top-h); display: flex; align-items: center;
  padding: 0 16px; background: rgba(13,13,26,0.95);
  backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0; overflow: hidden;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-info { min-width: 0; }
.topbar-name { font-size: 14px; font-weight: 600; truncate: true;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-balance { display: flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-card2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: background var(--transition);
}
.icon-btn svg { width: 18px; height: 18px; stroke: var(--text-secondary); }
.icon-btn:active { background: var(--bg-card); }

.notif-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); border-radius: 99px;
  font-size: 10px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* ────── Main Content ────── */
.main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding-bottom: var(--nav-h); position: relative;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.main-content::-webkit-scrollbar { display: none; }

.page { display: none; padding: 16px 16px 0; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.page-head p { color: var(--text-secondary); font-size: 14px; }

/* ────── Balance Card ────── */
.balance-card {
  background: linear-gradient(135deg, #1a1038, #1f1545, #162044);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: var(--radius); padding: 20px;
  text-align: center; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.balance-card::before {
  content: ''; position: absolute;
  top: -40px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(124,58,237,0.3) 0%, transparent 70%);
  pointer-events: none;
}
.balance-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.balance-amount {
  font-size: 36px; font-weight: 900;
  background: linear-gradient(135deg, #f7b731, #ff9500);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.coin-icon { width: 32px; height: 32px; flex-shrink: 0; }
.balance-sub { color: var(--text-muted); font-size: 13px; margin: 4px 0 16px; }
.balance-actions { display: flex; gap: 10px; justify-content: center; }

/* ────── Mining Card ────── */
.mining-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  margin-bottom: 16px; text-align: center;
  position: relative; overflow: hidden;
}
.mining-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.mining-label { font-size: 14px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.boost-badge {
  background: rgba(247,183,49,0.15); border: 1px solid var(--border-accent);
  border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: 4px;
}
.mining-btn-wrap { display: flex; justify-content: center; margin-bottom: 24px; position: relative; }

.mining-btn {
  width: 160px; height: 160px; border-radius: 50%;
  background: none; border: none; cursor: pointer; position: relative;
  transition: transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.mining-btn:active { transform: scale(0.92); }
.mining-btn-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,224,102,0.15) 0%, transparent 60%),
              linear-gradient(135deg, #2a1f08, #1a1200);
  border: 3px solid #f7b731;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px rgba(247,183,49,0.3), inset 0 0 30px rgba(247,183,49,0.05);
  transition: box-shadow var(--transition);
}
.mining-btn:active .mining-btn-inner {
  box-shadow: 0 0 50px rgba(247,183,49,0.5), inset 0 0 40px rgba(247,183,49,0.1);
}
.mining-icon { width: 80px; height: 80px; }

.tap-ripple {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 160px; height: 160px; border-radius: 50%;
  border: 2px solid rgba(247,183,49,0.5);
  opacity: 0; pointer-events: none;
}
.tap-ripple.active { animation: ripple 0.6s ease-out; }
@keyframes ripple { 0%{opacity:0.8;transform:translate(-50%,-50%) scale(1)} 100%{opacity:0;transform:translate(-50%,-50%) scale(1.8)} }

/* Floating coins */
#floatingCoins { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.float-coin {
  position: absolute; font-size: 18px; font-weight: 800; color: var(--accent);
  animation: floatUp 1s ease-out forwards;
  text-shadow: 0 0 10px rgba(247,183,49,0.5);
}
@keyframes floatUp {
  0%{opacity:1;transform:translateY(0) scale(1)}
  100%{opacity:0;transform:translateY(-80px) scale(0.6)}
}

/* Energy */
.energy-section { }
.energy-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.energy-label { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.energy-val { font-size: 13px; font-weight: 700; color: var(--accent); }
.energy-bar-wrap { height: 8px; background: var(--bg-primary); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.energy-bar-fill { height: 100%; background: linear-gradient(90deg, #f7b731, #ff9500); border-radius: 99px; transition: width 0.5s ease; }
.energy-regen { font-size: 11px; color: var(--text-muted); text-align: right; }

/* ────── Earn Grid ────── */
.earn-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
.earn-card {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  cursor: pointer; transition: all var(--transition); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.earn-card:active { transform: scale(0.96); border-color: var(--accent); }
.earn-icon { width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; }
.earn-icon svg { width: 22px; height: 22px; }
.spin-icon  { background: rgba(247,183,49,0.15); }
.spin-icon svg { stroke: var(--accent); }
.task-icon  { background: rgba(16,185,129,0.15); }
.task-icon svg { stroke: var(--accent3); }
.ref-icon   { background: rgba(124,58,237,0.15); }
.ref-icon svg { stroke: var(--accent2); }
.rosca-icon { background: rgba(59,130,246,0.15); }
.rosca-icon svg { stroke: #3b82f6; }
.earn-name { font-size: 14px; font-weight: 700; }
.earn-sub  { font-size: 11px; color: var(--text-secondary); }

/* ────── Section Card ────── */
.section-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.section-header {
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.view-all-btn {
  margin-left: auto; font-size: 12px; color: var(--accent2); background: none;
  border: none; cursor: pointer; font-weight: 600; padding: 0;
}

/* ────── Challenge List ────── */
.challenge-item {
  background: var(--bg-card2); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 10px;
}
.challenge-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.challenge-title { font-size: 14px; font-weight: 600; }
.challenge-reward { font-size: 13px; font-weight: 700; color: var(--accent); }
.challenge-prog-wrap { background: rgba(255,255,255,0.06); border-radius: 99px; height: 6px; overflow: hidden; }
.challenge-prog-bar { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 99px; transition: width 0.5s; }
.challenge-prog-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.challenge-done { display: flex; align-items: center; gap: 6px; color: var(--accent3); font-size: 13px; font-weight: 600; }

/* ────── Tabs ────── */
.tabs-row { display: flex; gap: 6px; margin-bottom: 16px; background: var(--bg-card2); padding: 4px; border-radius: var(--radius-sm); }
.tab-btn {
  flex: 1; padding: 8px 4px; background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-secondary); border-radius: 8px;
  transition: all var(--transition);
}
.tab-btn.active { background: var(--bg-card); color: var(--text-primary); }
.tabs-row.small { margin-top: 10px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ────── Task Items ────── */
.task-item {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
}
.task-icon-wrap {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(124,58,237,0.15);
}
.task-icon-wrap svg { width: 22px; height: 22px; stroke: var(--accent2); }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.task-reward { font-size: 13px; color: var(--accent); font-weight: 700; }
.task-action { flex-shrink: 0; }
.btn-task {
  padding: 8px 14px; border-radius: 20px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; transition: all var(--transition);
}
.btn-task.start { background: linear-gradient(135deg, var(--accent2), #5b21b6); color: #fff; }
.btn-task.done  { background: rgba(16,185,129,0.15); color: var(--accent3); cursor: default; }
.btn-task:active { transform: scale(0.95); }

/* ────── Invest Plans ────── */
.invest-plan {
  background: linear-gradient(135deg, var(--bg-card2), var(--bg-card));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 12px;
}
.invest-plan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.invest-plan-name { font-size: 16px; font-weight: 800; }
.invest-plan-roi {
  background: rgba(16,185,129,0.15); color: var(--accent3);
  border-radius: 99px; padding: 4px 10px; font-size: 13px; font-weight: 700;
}
.invest-plan-details { display: flex; gap: 12px; margin-bottom: 14px; }
.invest-plan-detail { flex: 1; }
.invest-plan-detail-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.invest-plan-detail-val { font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* Active contracts */
.contract-item {
  background: var(--bg-card2); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 10px;
}
.contract-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.contract-plan { font-size: 14px; font-weight: 700; }
.contract-status { font-size: 12px; padding: 3px 8px; border-radius: 99px; font-weight: 600; }
.contract-status.active { background: rgba(16,185,129,0.15); color: var(--accent3); }
.contract-status.completed { background: rgba(124,58,237,0.15); color: var(--accent2); }
.contract-detail { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.contract-detail span:first-child { color: var(--text-secondary); }
.contract-detail span:last-child { font-weight: 600; }
.contract-timer { font-size: 11px; color: var(--accent); margin-top: 8px; font-weight: 600; }

/* ────── Referral Page ────── */
.ref-rewards-card {
  background: var(--bg-card); border: 1px solid var(--border-accent);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  display: flex; align-items: center;
}
.ref-reward-item { flex: 1; display: flex; align-items: center; gap: 12px; }
.ref-reward-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(247,183,49,0.1);
  display: flex; align-items: center; justify-content: center; }
.ref-reward-icon svg { width: 22px; height: 22px; }
.ref-reward-title { font-size: 11px; color: var(--text-secondary); }
.ref-reward-amount { font-size: 18px; font-weight: 800; color: var(--accent); }
.ref-divider { width: 1px; height: 50px; background: var(--border); margin: 0 16px; }
.ref-link-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.ref-link-box {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.ref-link-text { flex: 1; font-size: 12px; color: var(--text-secondary); word-break: break-all; font-family: monospace; }
.copy-btn { background: rgba(247,183,49,0.15); border: none; border-radius: 8px;
  padding: 6px; cursor: pointer; flex-shrink: 0; }
.copy-btn svg { width: 16px; height: 16px; stroke: var(--accent); display: block; }
.copy-btn:active { background: rgba(247,183,49,0.3); }

/* ────── Leaderboard ────── */
.lb-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-bottom: 1px solid var(--border);
}
.lb-item:last-child { border-bottom: none; }
.lb-rank {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}
.lb-rank.rank-1 { background: linear-gradient(135deg, #f7b731,#e6a100); color: #1a1a00; }
.lb-rank.rank-2 { background: linear-gradient(135deg, #c0c0c0,#888); color: #fff; }
.lb-rank.rank-3 { background: linear-gradient(135deg, #cd7f32,#8b4513); color: #fff; }
.lb-rank.rank-n { background: var(--bg-card2); color: var(--text-secondary); }
.lb-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; overflow: hidden;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-badges { display: flex; gap: 4px; }
.lb-score { font-size: 14px; font-weight: 800; color: var(--accent); }
.badge-pill {
  background: rgba(247,183,49,0.15); border: 1px solid var(--border-accent);
  border-radius: 99px; padding: 2px 7px; font-size: 10px; font-weight: 700; color: var(--accent);
}
.badge-pill.verified { background: rgba(16,185,129,0.15); color: var(--accent3); border-color: rgba(16,185,129,0.3); }
.badge-pill.influencer { background: rgba(124,58,237,0.15); color: var(--accent2); border-color: rgba(124,58,237,0.3); }

.league-info { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ────── Profile ────── */
.profile-header { text-align: center; padding: 20px 16px; }
.profile-avatar-wrap { position: relative; width: 80px; margin: 0 auto 12px; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border: 3px solid var(--accent); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-badge {
  position: absolute; bottom: 0; right: 0;
  width: 24px; height: 24px; background: var(--bg-primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.profile-badge svg { width: 20px; height: 20px; }
.profile-name { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.profile-username { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.profile-badges-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px 16px;
}
.stat-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; text-align: center;
}
.stat-val { font-size: 20px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.stat-lbl { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

/* ────── Forms ────── */
.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.input-field {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: var(--text-primary); font-size: 15px; width: 100%;
  font-family: inherit; transition: border var(--transition);
  -webkit-appearance: none;
}
.input-field:focus { outline: none; border-color: var(--accent2); }
.input-field::placeholder { color: var(--text-muted); }
select.input-field { cursor: pointer; }
.form-group { display: flex; flex-direction: column; gap: 10px; }

/* ────── Buttons ────── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent2), #5b21b6);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 12px 20px; font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--transition); font-family: inherit;
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary svg { width: 18px; height: 18px; }

.btn-gold {
  background: linear-gradient(135deg, #f7b731, #e69500);
  color: #1a1000; border: none; border-radius: var(--radius-sm);
  padding: 12px 20px; font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--transition); font-family: inherit;
}
.btn-gold:active { transform: scale(0.97); }
.btn-gold svg { width: 18px; height: 18px; }

.btn-outline {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--transition); font-family: inherit;
}
.btn-outline:active { border-color: var(--accent); color: var(--accent); }
.btn-outline svg { width: 16px; height: 16px; }

.btn-small { padding: 8px 14px; font-size: 13px; border-radius: 20px; }

.full-width { width: 100%; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }

.hint-text { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ────── Bottom Nav ────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h); background: rgba(13,13,26,0.98);
  backdrop-filter: blur(20px); border-top: 1px solid var(--border);
  display: flex; align-items: center; z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; background: none; border: none; cursor: pointer; padding: 8px 4px;
  color: var(--text-muted); transition: color var(--transition);
}
.nav-btn svg { width: 22px; height: 22px; transition: stroke var(--transition); }
.nav-btn span { font-size: 10px; font-weight: 600; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active svg { stroke: var(--accent); }

.nav-center { position: relative; }
.nav-center-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #e69500);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(247,183,49,0.4);
  margin-bottom: 2px;
}
.nav-center-btn svg { width: 24px; height: 24px; stroke: #1a1000; }
.nav-center.active .nav-center-btn { background: linear-gradient(135deg, #ff9500, #f7b731); }

/* ────── Modals ────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn { from{opacity:0} to{opacity:1} }

.modal-sheet {
  background: var(--bg-card); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 480px; max-height: 92vh;
  display: flex; flex-direction: column;
  animation: sheetUp 0.3s cubic-bezier(0.4,0,0.2,1);
}
.large-sheet { max-height: 96vh; }
@keyframes sheetUp { from{transform:translateY(100%)} to{transform:translateY(0)} }

.modal-handle { width: 40px; height: 4px; background: rgba(255,255,255,0.15); border-radius: 99px; margin: 12px auto 0; flex-shrink: 0; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; font-size: 17px; font-weight: 700; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.modal-close { background: var(--bg-card2); border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close svg { width: 16px; height: 16px; stroke: var(--text-secondary); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; scrollbar-width: none; }
.modal-body::-webkit-scrollbar { display: none; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ────── Spin Wheel ────── */
.spin-modal-body { display: flex; flex-direction: column; align-items: center; }
.spin-wheel-wrap { position: relative; width: 280px; height: 280px; margin: 0 auto; }
#spinCanvas { border-radius: 50%; box-shadow: 0 0 40px rgba(247,183,49,0.3); }
.spin-arrow {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 24px; z-index: 10;
}
.spin-arrow svg { width: 24px; height: 24px; }
.spin-result { text-align: center; margin-top: 20px; }
.spin-result-icon { width: 56px; height: 56px; margin: 0 auto 12px; }
.spin-result-icon svg { width: 56px; height: 56px; }
.spin-result-text { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.spin-result-amount { font-size: 28px; font-weight: 900; color: var(--accent); }
.spin-timer { font-size: 13px; color: var(--text-secondary); text-align: center; }

/* ────── Video Modal ────── */
.video-wrap { border-radius: var(--radius-sm); overflow: hidden; background: #000; aspect-ratio: 16/9; margin-bottom: 14px; }
.video-iframe { width: 100%; height: 100%; }
.video-progress-wrap { height: 6px; background: var(--bg-card2); border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.video-progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 99px; width: 0; transition: width 1s linear; }
.video-timer { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }

/* ────── ROSCA ────── */
.rosca-group {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px;
}
.rosca-group-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.rosca-group-name { font-size: 15px; font-weight: 700; }
.rosca-group-badge { font-size: 11px; padding: 3px 8px; border-radius: 99px; font-weight: 600; }
.rosca-group-badge.open { background: rgba(16,185,129,0.15); color: var(--accent3); }
.rosca-group-badge.active { background: rgba(247,183,49,0.15); color: var(--accent); }
.rosca-group-badge.completed { background: var(--bg-primary); color: var(--text-muted); }
.rosca-detail { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.rosca-detail span:first-child { color: var(--text-secondary); }

/* ────── Invest Modal ────── */
.invest-modal-plan { background: var(--bg-card2); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; }
.invest-calc { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 4px; }

/* ────── Transaction History ────── */
.tx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.tx-item:last-child { border-bottom: none; }
.tx-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tx-icon svg { width: 18px; height: 18px; }
.tx-icon.pos { background: rgba(16,185,129,0.15); }
.tx-icon.pos svg { stroke: var(--accent3); }
.tx-icon.neg { background: rgba(239,68,68,0.15); }
.tx-icon.neg svg { stroke: var(--danger); }
.tx-info { flex: 1; min-width: 0; }
.tx-label { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-date  { font-size: 11px; color: var(--text-muted); }
.tx-amount { font-size: 14px; font-weight: 800; }
.tx-amount.pos { color: var(--accent3); }
.tx-amount.neg { color: var(--danger); }

/* ────── Withdraw form ────── */
.withdraw-form { display: flex; flex-direction: column; gap: 10px; }

/* ────── Toast ────── */
.toast-container { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 18px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
}
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.success svg { stroke: var(--accent3); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.error svg { stroke: var(--danger); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes toastIn { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:none} }

/* ────── Winner Popup ────── */
.winner-popup {
  background: var(--bg-card); border: 2px solid var(--accent);
  border-radius: var(--radius); padding: 32px 24px; text-align: center;
  max-width: 320px; width: 90%; position: relative; overflow: hidden;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn { from{opacity:0;transform:scale(0.7)} to{opacity:1;transform:scale(1)} }
.winner-icon { width: 64px; height: 64px; margin: 0 auto 16px; }
.winner-icon svg { width: 64px; height: 64px; }
.winner-title { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.winner-msg { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.winner-amount { font-size: 32px; font-weight: 900; color: var(--accent); }

/* Skeleton loaders */
.skeleton-line { height: 16px; background: var(--bg-card2); border-radius: 4px; margin-bottom: 8px; animation: pulse 1.5s infinite; }
.skeleton-line.short { width: 60%; }
.skeleton-card { height: 80px; background: var(--bg-card2); border-radius: var(--radius-sm); margin-bottom: 10px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* Icon sizes */
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 18px; height: 18px; }

/* Notification items */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { opacity: 1; }
.notif-item.read { opacity: 0.6; }
.notif-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-card2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-icon svg { width: 20px; height: 20px; stroke: var(--accent); }
.notif-info { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.notif-msg { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }

/* Empty state */
.empty-state { text-align: center; padding: 32px 16px; }
.empty-state svg { width: 48px; height: 48px; stroke: var(--text-muted); margin: 0 auto 12px; display: block; }
.empty-state p { color: var(--text-muted); font-size: 14px; }

/* Referral member item */
.ref-member {
  display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.ref-member:last-child { border-bottom: none; }
.ref-member-avatar { width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2),var(--accent));
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.ref-member-name { flex: 1; font-size: 14px; font-weight: 600; }
.ref-member-date { font-size: 11px; color: var(--text-muted); }
