:root {
  --bg-primary: #070a0e;
  --bg-secondary: #0e141d;
  --bg-card: rgba(16, 24, 35, 0.75);
  --bg-card-border: rgba(0, 230, 118, 0.15);
  --accent: #00e676;
  --accent-glow: rgba(0, 230, 118, 0.25);
  --accent-dark: #00b0ff;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --gold: #fbbf24;
  --danger: #ef4444;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 84px; /* Space for bottom nav */
  overflow-x: hidden;
  background-image: radial-gradient(circle at 50% -10%, rgba(0, 230, 118, 0.12) 0%, transparent 60%);
}

.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(14, 20, 29, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid var(--bg-card-border);
  margin-bottom: 18px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e676, #00b0ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #070a0e;
  box-shadow: 0 0 12px var(--accent-glow);
}

.user-meta .user-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.user-meta .user-badge {
  font-size: 0.70rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-balance-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
}

/* Screens */
.screen {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.screen.is-active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Balance Card */
.balance-hero-card {
  background: linear-gradient(135deg, rgba(16, 28, 40, 0.9) 0%, rgba(9, 18, 26, 0.95) 100%);
  border: 1px solid var(--accent-glow);
  box-shadow: 0 8px 24px rgba(0, 230, 118, 0.08);
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.balance-hero-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 230, 118, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.balance-label {
  font-size: 0.80rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.main-balance {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.main-balance .coin-icon {
  font-size: 1.8rem;
}

.sub-balance-usdt {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, #00e676, #00c853);
  color: #070a0e;
  font-weight: 700;
  border: none;
  padding: 10px 22px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.90rem;
  box-shadow: 0 4px 14px rgba(0, 230, 118, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.90rem;
}

/* Daily Streak Section */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.streak-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.streak-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.streak-day {
  background: rgba(14, 20, 29, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  transition: all 0.2s;
}

.streak-day.is-claimed {
  background: rgba(0, 230, 118, 0.12);
  border-color: var(--accent);
}

.streak-day.is-active-today {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.streak-day .day-num {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
}

.streak-day .day-reward {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-top: 4px;
}

.streak-day.is-claimed .day-reward {
  color: #ffffff;
}

.btn-checkin {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  background: linear-gradient(135deg, #00e676, #00b0ff);
  color: #070a0e;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 230, 118, 0.3);
}

.btn-checkin:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* Category Filter Pills */
.category-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.category-filter::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.80rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.filter-pill.is-active {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent);
  border-color: var(--accent);
}

/* Task List */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 14px;
  padding: 12px 14px;
  transition: transform 0.15s, border-color 0.15s;
}

.task-card:hover {
  border-color: var(--accent);
}

.task-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.task-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 0.90rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.reward-tag {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}

.task-action-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  flex-shrink: 0;
  margin-left: 8px;
}

.task-action-btn.btn-start {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.task-action-btn.btn-verifying {
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.3);
  cursor: wait;
}

.task-action-btn.btn-claim {
  background: var(--accent);
  color: #070a0e;
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse 1.5s infinite;
}

.task-action-btn.btn-completed {
  background: rgba(255, 255, 255, 0.05);
  color: #64748b;
  cursor: default;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Invite / Referral Screen */
.invite-hero {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.15) 0%, rgba(0, 176, 255, 0.15) 100%);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 24px 18px;
  text-align: center;
  margin-bottom: 20px;
}

.invite-hero h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff;
}

.invite-hero p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.share-btn-wrap {
  display: flex;
  gap: 10px;
}

.share-btn-wrap .btn-primary {
  flex: 2;
}

.share-btn-wrap .btn-secondary {
  flex: 1;
}

.referral-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.stat-box .stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-box .stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Withdraw Screen */
.withdraw-box {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.input-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.custom-input, .custom-select {
  width: 100%;
  background: rgba(7, 10, 14, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 0.92rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.custom-input:focus, .custom-select:focus {
  border-color: var(--accent);
}

.withdrawal-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 8px;
}

.status-badge {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.status-badge.status-pending {
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
}

.status-badge.status-approved {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(14, 20, 29, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--bg-card-border);
  display: flex;
  justify-content: space-around;
  padding: 8px 12px 14px;
  z-index: 100;
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 12px;
  transition: color 0.15s;
}

.nav-item .nav-icon {
  font-size: 1.3rem;
  margin-bottom: 3px;
  transition: transform 0.15s;
}

.nav-item .nav-label {
  font-size: 0.70rem;
  font-weight: 600;
}

.nav-item.is-active {
  color: var(--accent);
}

.nav-item.is-active .nav-icon {
  transform: translateY(-2px);
}

/* Toast Message */
.toast-msg {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(16, 24, 35, 0.95);
  border: 1px solid var(--accent);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 18px rgba(0, 230, 118, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
