:root {
  --primary: #2a5298;
  --primary-dark: #1e3c72;
  --primary-light: #6f8fc7;
  --accent: #00c853;
  --bg: #f4f5fa;
  --card: #ffffff;
  --ink: #1e1e2d;
  --muted: #8a8aa3;
  --border: #ececf3;
  --amber: #ffb020;
  --green: #21c17c;
  --red: #ff5c5c;
  --upi: #4f46e5;
  --paytm: #00baf2;
  --amazonpay: #ff9900;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.phone {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 84px;
  box-shadow: 0 0 40px rgba(30, 30, 45, 0.08);
}

/* Top app bar */
.appbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 20px 20px 56px;
  border-radius: 0 0 28px 28px;
  position: relative;
}

.appbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.appbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.appbar-back {
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.appbar-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  font-size: 16px;
}

/* Balance card overlapping the app bar */
.balance-card {
  background: var(--card);
  margin: -44px 16px 0;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(30, 30, 45, 0.12);
  position: relative;
  z-index: 2;
}

.balance-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.balance-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}

.coin-icon {
  font-size: 28px;
}

.balance-coins {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.balance-cash {
  margin-top: 4px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.balance-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.pill-btn {
  flex: 1;
  text-align: center;
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.pill-btn.primary {
  background: var(--primary);
  color: #fff;
}

.pill-btn.ghost {
  background: #f1f0fb;
  color: var(--primary-dark);
}

/* Content sections */
.content { padding: 20px 16px 12px; }

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 22px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title .link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* Watch-ad card */
.earn-card {
  background: linear-gradient(135deg, #1e3c72, #2a5298 70%);
  border-radius: 20px;
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.earn-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.earn-card p {
  margin: 0 0 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.watch-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.watch-btn:active { transform: scale(0.98); }

.watch-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Full-screen ad simulation modal */
.ad-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: #fff;
  text-align: center;
  padding: 20px;
}

.ad-modal.show { display: flex; }

.ad-modal .ad-title { font-size: 17px; font-weight: 700; }

.timer-circle {
  font-size: 32px;
  font-weight: 800;
  margin: 18px 0;
  border: 4px solid var(--accent);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-modal .ad-hint { font-size: 12.5px; color: #b8b8c8; }

/* Task list */
.task-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.task-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f1f0fb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

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

.task-title {
  font-size: 14px;
  font-weight: 700;
}

.task-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.task-reward {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 4px;
}

.task-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.task-btn.done {
  background: #eafaf3;
  color: var(--green);
  cursor: default;
}

.task-btn.wait {
  background: #f1f0fb;
  color: var(--muted);
  cursor: default;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}

.nav-item {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.nav-item .nav-icon { font-size: 20px; }

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

/* Withdraw page: methods */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.method-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
}

.method-card.selected {
  border-color: var(--primary);
  background: #f6f4ff;
}

.method-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  font-weight: 800;
}

.method-badge.upi { background: var(--upi); }
.method-badge.paytm { background: var(--paytm); }
.method-badge.amazonpay { background: var(--amazonpay); }

.method-name { font-size: 12px; font-weight: 700; }

/* Form */
.form-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
  border: 1px solid var(--border);
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: #fafafe;
  font-family: inherit;
}

.field input:focus { outline: 2px solid var(--primary-light); }

.chip-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 7px 12px;
  border-radius: 999px;
  background: #f1f0fb;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.cash-preview {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 6px;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  margin-top: 4px;
}

.submit-btn:disabled {
  background: #cfcbe8;
  cursor: not-allowed;
}

.hint { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* History */
.history-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  font-weight: 800;
  flex-shrink: 0;
}

.history-info { flex: 1; min-width: 0; }
.history-method { font-size: 13px; font-weight: 700; }
.history-date { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.history-amount { text-align: right; }
.history-cash { font-size: 14px; font-weight: 800; }
.history-coins { font-size: 11px; color: var(--muted); }

.status-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.status-badge.pending { background: #fff4e0; color: var(--amber); }
.status-badge.approved { background: #e5faf1; color: var(--green); }
.status-badge.rejected { background: #ffe9e9; color: var(--red); }

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 28px 10px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #201f33;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
  max-width: 90%;
  text-align: center;
}

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