@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #06060a;
  --bg-elevated: #0c0c12;
  --bg-card: rgba(255,255,255,0.02);
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #ededf0;
  --text-dim: #6e6e82;
  --text-faint: #3a3a4e;
  --accent: #10b981;
  --accent-hover: #0ea572;
  --accent-soft: rgba(16,185,129,0.08);
  --accent-border: rgba(16,185,129,0.2);
  --red: #ef4444;
  --yellow: #f59e0b;
  --blue: #3b82f6;
  --purple: #a78bfa;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }

/* ===== Backgrounds ===== */
.scene { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.scene-grad { background: radial-gradient(ellipse at 30% -20%, rgba(16,185,129,0.06) 0%, transparent 50%), radial-gradient(ellipse at 80% 100%, rgba(16,185,129,0.03) 0%, transparent 40%); position: absolute; inset: 0; }
.scene-dots { background-image: radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px); background-size: 28px 28px; position: absolute; inset: 0; }

/* ===== Utility ===== */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.text-center { text-align: center; }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* ===== Typography ===== */
.heading-xl { font-size: 52px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; }
.heading-lg { font-size: 32px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
.heading-md { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.heading-sm { font-size: 16px; font-weight: 700; }
.body-lg { font-size: 17px; line-height: 1.7; color: var(--text-dim); }
.body-sm { font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); }
.gradient-text { background: linear-gradient(135deg, #10b981, #34d399, #6ee7b7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  cursor: pointer; transition: all 0.15s; font-family: inherit; text-decoration: none;
}
.btn:hover { background: rgba(255,255,255,0.07); border-color: var(--border-hover); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.25); color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 15px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-pill { border-radius: 100px; }
.btn .arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-hover); }
.card-glass {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s, transform 0.3s;
}
.card-glass:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.card-accent {
  background: linear-gradient(135deg, rgba(16,185,129,0.04), rgba(16,185,129,0.01));
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xl);
}

/* ===== Inputs ===== */
.input, .select, .textarea {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 80px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }

/* ===== Badges ===== */
.badge { display: inline-flex; padding: 3px 10px; border-radius: 100px; font-size: 10px; font-weight: 700; letter-spacing: 0.3px; }
.badge-green { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.badge-yellow { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.badge-red { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-blue { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.badge-gray { background: rgba(255,255,255,0.05); color: var(--text-dim); border: 1px solid var(--border); }

/* ===== Alerts ===== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; display: none; margin-bottom: 14px; }
.alert.show { display: block; }
.alert-error { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: #f87171; }
.alert-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); color: #34d399; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); padding: 12px 24px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 14px; font-weight: 600; z-index: 9999; opacity: 0; transition: opacity 0.3s; pointer-events: none; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; }
.toast.success { border-color: rgba(16,185,129,0.4); color: #34d399; }
.toast.error { border-color: rgba(239,68,68,0.4); color: #f87171; }
.toast.info { border-color: rgba(99,102,241,0.4); color: #818cf8; }

/* ===== Stats ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.stat-label { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 900; margin: 4px 0 2px; letter-spacing: -0.02em; }
.stat-sub { font-size: 10px; color: var(--text-dim); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.data-table tr:hover td { background: rgba(255,255,255,0.015); }

/* ===== Modals ===== */
.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-bg { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.modal-box { position: relative; background: var(--bg-elevated); border: 1px solid var(--accent-border); border-radius: var(--radius-lg); max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 22px; cursor: pointer; padding: 4px; }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Loading ===== */
.loading { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Empty ===== */
.empty { text-align: center; padding: 48px 20px; color: var(--text-dim); }
.empty .icon { font-size: 40px; margin-bottom: 12px; opacity: 0.6; }

/* ===== Post cards ===== */
.post-list { display: flex; flex-direction: column; gap: 8px; }
.post-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; transition: border-color 0.2s; }
.post-row:hover { border-color: var(--accent-border); }
.post-info { flex: 1; min-width: 0; }
.post-url { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.post-metrics { display: flex; gap: 12px; font-size: 11px; color: var(--text-dim); margin-top: 5px; }
.post-metrics span { display: flex; align-items: center; gap: 3px; }

/* ===== Leaderboard ===== */
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; flex-shrink: 0; }
.lb-rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; border: none; }
.lb-rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #000; border: none; }
.lb-rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; border: none; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 14px; font-weight: 700; }
.lb-score { font-size: 12px; color: var(--text-dim); }
.lb-earn { text-align: right; font-size: 14px; font-weight: 700; color: var(--accent); }

/* ===== Countdown ===== */
.countdown { display: flex; gap: 12px; justify-content: center; }
.countdown-item { text-align: center; }
.countdown-num { font-size: 36px; font-weight: 900; color: var(--accent); line-height: 1; }
.countdown-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* ===== Show more ===== */
.show-more-wrap { display: flex; justify-content: center; padding: 18px 0 4px; }
.show-more-btn { background: rgba(255,255,255,0.03); border: 1px solid var(--border); color: var(--text-dim); font-size: 13px; font-weight: 600; padding: 10px 32px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.show-more-btn:hover { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }

/* ===== Auth pages ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 36px 32px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; text-decoration: none; color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.auth-brand .brand-logo { width: 32px; height: 32px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.auth-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.03em; }
.auth-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }
.auth-divider { text-align: center; color: var(--text-faint); font-size: 12px; margin: 22px 0; position: relative; }
.auth-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.auth-divider span { background: var(--bg-elevated); padding: 0 14px; position: relative; }
.auth-foot { text-align: center; font-size: 14px; color: var(--text-dim); }
.auth-foot a { color: var(--accent); font-weight: 600; }
.back-link { position: fixed; top: 20px; left: 20px; color: var(--text-dim); font-size: 13px; font-weight: 600; z-index: 10; text-decoration: none; display: flex; align-items: center; gap: 4px; }
.back-link:hover { color: var(--text); }

/* ===== App layout ===== */
.app-layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: 220px; position: fixed; top: 0; left: 0; bottom: 0;
  background: var(--bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 12px; overflow-y: auto; z-index: 100;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; color: var(--text); }
.sidebar .brand-logo { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.sidebar nav { flex: 1; }
.sidebar .nav-section { font-size: 9px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 1.5px; padding: 16px 8px 6px; }
.sidebar .nav-section:first-child { padding-top: 0; }
.sidebar a { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-dim); font-size: 13px; font-weight: 600; transition: all 0.15s; cursor: pointer; text-decoration: none; }
.sidebar a:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar a .icon { font-size: 15px; width: 20px; text-align: center; }
.sidebar-foot { padding-top: 14px; border-top: 1px solid var(--border); margin-top: auto; }
.sidebar-foot .user-card { display: flex; align-items: center; gap: 10px; padding: 8px; }
.sidebar-foot .avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.sidebar-foot .user-info { flex: 1; min-width: 0; }
.sidebar-foot .user-info .name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .user-info .balance { font-size: 11px; color: var(--accent); font-weight: 600; }
.sidebar-foot a { color: var(--text-faint); font-size: 11px; padding: 4px 8px; cursor: pointer; }

.main { margin-left: 220px; flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
.app-topbar h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.app-topbar .sub { font-size: 11px; color: var(--text-faint); letter-spacing: 0.5px; text-transform: uppercase; margin-top: 2px; }
.app-content { padding: 24px 28px; flex: 1; }

/* ===== Mobile nav ===== */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(6,6,10,0.95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 8px env(safe-area-inset-bottom, 6px);
  z-index: 1000; justify-content: space-around;
}
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 1; padding: 8px 4px 6px; font-size: 10px; font-weight: 600;
  color: var(--text-faint); text-decoration: none; cursor: pointer;
  border-radius: 8px; -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item.active { color: var(--accent); background: var(--accent-soft); }
.mobile-nav-icon { font-size: 18px; line-height: 1; }

/* More drawer */
.more-drawer { position: fixed; inset: 0; z-index: 1001; }
.more-drawer.hidden { display: none; }
.more-drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.more-drawer-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--bg-elevated); border-top: 1px solid var(--border-hover);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom, 8px));
  max-height: 70vh; overflow-y: auto;
  animation: slideUp 0.2s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.more-drawer-title { font-size: 16px; font-weight: 800; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.more-drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.more-drawer-item {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.more-drawer-item:hover { background: var(--accent-soft); color: var(--text); border-color: var(--accent-border); }
.more-drawer-item span:first-child { font-size: 18px; }

/* ===== Animations ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 20px rgba(16,185,129,0.15); } 50% { box-shadow: 0 0 40px rgba(16,185,129,0.3); } }
@keyframes pulse-ring { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(2); opacity: 0; } }
@keyframes shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
.anim-up { animation: fadeUp 0.5s ease-out both; }
.anim-up-1 { animation-delay: 0.08s; }
.anim-up-2 { animation-delay: 0.16s; }
.anim-up-3 { animation-delay: 0.24s; }
.anim-up-4 { animation-delay: 0.32s; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .mobile-nav { display: flex; }
  .app-topbar { padding: 16px 18px; }
  .app-topbar h1 { font-size: 18px; }
  .app-content { padding: 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .heading-xl { font-size: 34px; }
  .heading-lg { font-size: 24px; }
  .container { padding: 0 18px; }
}
@media (max-width: 480px) {
  .countdown { gap: 8px; }
  .countdown-num { font-size: 26px; }
}
