/* ════════════════════════════════════════════
   STEEPEARN — Gamified Walk-to-Earn Design
   ════════════════════════════════════════════ */

:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a28;
  --gold: #FFB800;
  --gold2: #FFD700;
  --gold-dim: rgba(255,184,0,0.15);
  --purple: #7C3AED;
  --purple2: #A78BFA;
  --pink: #E040A0;
  --green: #10B981;
  --green-dim: rgba(16,185,129,0.12);
  --red: #EF4444;
  --text: #fff;
  --text2: rgba(255,255,255,0.7);
  --text3: rgba(255,255,255,0.3);
  --card-bg: rgba(255,255,255,0.03);
  --card-border: rgba(255,255,255,0.06);
}

* { margin:0; padding:0; box-sizing:border-box; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
}
[x-cloak] { display: none !important; }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

/* ─── Screen Layout ─── */
.screen {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* ─── SPLASH ─── */
.splash-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.splash-content { text-align: center; }
.splash-logo {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 40px;
  box-shadow: 0 8px 40px rgba(255,184,0,0.25);
  animation: pulse-logo 1.5s ease-in-out infinite;
}
@keyframes pulse-logo {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 40px rgba(255,184,0,0.25); }
  50% { transform: scale(1.05); box-shadow: 0 8px 60px rgba(255,184,0,0.4); }
}
.splash-title {
  font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.splash-sub { color: var(--text3); font-size: 13px; margin-top: 4px; }
.splash-loader {
  width: 160px; height: 3px; background: rgba(255,255,255,0.05);
  border-radius: 3px; margin: 24px auto 0; overflow: hidden;
}
.splash-bar {
  width: 40%; height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 3px;
  animation: slide-bar 1.2s ease-in-out infinite;
}
@keyframes slide-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ─── AUTH SCREEN ─── */
.auth-screen {
  display: flex; flex-direction: column;
  padding: 40px 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.08), transparent 60%),
              radial-gradient(ellipse at 50% 100%, rgba(255,184,0,0.05), transparent 50%),
              var(--bg);
}
.bg-particles {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.particle {
  position: absolute;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  top: var(--y); left: var(--x);
  opacity: 0.15;
  animation: float-particle var(--d) ease-in-out infinite;
  transform: scale(var(--s));
}
@keyframes float-particle {
  0%, 100% { transform: scale(var(--s)) translateY(0); opacity: 0.15; }
  50% { transform: scale(var(--s)) translateY(-20px); opacity: 0.3; }
}
.auth-container {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column; justify-content: center;
}
.auth-hero { text-align: center; margin-bottom: 28px; }
.auth-icon-wrap {
  width: 72px; height: 72px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  box-shadow: 0 8px 32px rgba(255,184,0,0.2);
}
.auth-title {
  font-size: 30px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-tagline { color: var(--text2); font-size: 15px; margin-top: 6px; line-height: 1.5; }

/* Bonus Card */
.bonus-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255,184,0,0.08), rgba(255,215,0,0.03));
  border: 1px solid rgba(255,184,0,0.15);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 28px;
  overflow: hidden;
}
.bonus-glow {
  position: absolute; top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(255,184,0,0.12), transparent);
}
.bonus-content {
  display: flex; align-items: center; gap: 14px; position: relative;
}
.bonus-emoji { font-size: 32px; }
.bonus-label { font-size: 12px; color: var(--text3); letter-spacing: 0.5px; text-transform: uppercase; }
.bonus-value {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* Auth Form */
.auth-form { margin-bottom: 12px; }
.auth-buttons { display: flex; flex-direction: column; gap: 12px; }
.auth-form-fields { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.field input {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--bg2);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus { border-color: var(--gold); }
.auth-switch { text-align: center; font-size: 13px; color: var(--text3); }
.auth-switch a { color: var(--gold); text-decoration: none; font-weight: 600; }
.auth-error { text-align: center; color: var(--red); font-size: 13px; margin-top: 8px; }

/* ─── BUTTONS ─── */
.btn {
  padding: 14px 24px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #e6a000);
  color: #000;
  box-shadow: 0 4px 20px rgba(255,184,0,0.2);
}
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text2);
}
.btn-full { width: 100%; }

/* ─── APP SHELL ─── */
.app-screen {
  display: flex; flex-direction: column;
  padding-top: 0;
}

/* Header */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 10;
}
.header-brand { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; color: var(--gold); }
.header-balance {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--gold-dim);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.header-balance:active { background: rgba(255,184,0,0.2); }
.coin-icon { font-size: 16px; }
.coin-amount { font-weight: 700; font-size: 14px; color: var(--gold); }

/* Content */
.app-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 16px 20px 80px;
}

/* ─── DASHBOARD ─── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 18px; font-weight: 700; }
.date-badge {
  font-size: 12px; color: var(--text3);
  padding: 4px 12px; border-radius: 10px;
  background: var(--card-bg); border: 1px solid var(--card-border);
}

/* Step Ring */
.step-ring-wrap {
  position: relative; width: 200px; height: 200px;
  margin: 10px auto 24px;
  cursor: pointer;
}
.step-ring { transform: rotate(-90deg); width: 200px; height: 200px; }
.ring-bg {
  fill: none; stroke: rgba(255,255,255,0.04); stroke-width: 10;
}
.ring-progress {
  fill: none; stroke: url(#goldGrad);
  stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 565.48;
  transition: stroke-dashoffset 0.5s ease;
}
.ring-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center;
}
.ring-steps { display: block; font-size: 32px; font-weight: 800; color: var(--gold); }
.ring-label { font-size: 12px; color: var(--text3); display: block; margin-top: -2px; }
.ring-goal { font-size: 12px; color: var(--text3); display: block; margin-top: 2px; }

/* Bonus Banner */
.bonus-banner {
  background: linear-gradient(135deg, rgba(255,184,0,0.1), rgba(255,215,0,0.05));
  border: 1px solid rgba(255,184,0,0.15);
  border-radius: 14px; padding: 14px 18px;
  text-align: center; margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.confetti-burst { font-size: 20px; margin-bottom: 4px; }
.bonus-banner-text { font-size: 13px; color: var(--gold2); }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
}
.stat-icon { font-size: 24px; }
.stat-body { display: flex; flex-direction: column; }
.stat-value { font-size: 20px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--text3); }
.stat-earned .stat-value { color: var(--gold); }
.stat-streak .stat-value { color: #FF6B35; }
.stat-calories .stat-value { color: #60A5FA; }
.stat-distance .stat-value { color: var(--purple2); }

/* Card */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.card-header h3 { font-size: 13px; color: var(--text2); font-weight: 600; }

/* Week Chart */
.week-chart {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 16px 18px;
  height: 140px;
}
.bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px; height: 100%; justify-content: flex-end;
}
.bar-wrap {
  width: 100%; height: 100px;
  display: flex; align-items: flex-end; justify-content: center;
}
.bar-fill {
  width: 60%; max-width: 24px;
  background: linear-gradient(180deg, var(--purple2), var(--purple));
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
  transition: height 0.3s;
}
.bar-today { background: linear-gradient(180deg, var(--gold), #e6a000); }
.bar-label { font-size: 10px; color: var(--text3); }

/* ─── WALK SCREEN ─── */
.walk-screen { text-align: center; padding-top: 10px; }
.walk-counter {
  position: relative;
  width: 200px; height: 200px;
  margin: 20px auto;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.walk-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(255,184,0,0.08), transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
}
.walk-emoji { font-size: 32px; position: relative; }
.walk-steps { font-size: 44px; font-weight: 800; position: relative; }
.walk-label { font-size: 13px; color: var(--text3); position: relative; }
.walk-earnings { font-size: 14px; margin-top: 4px; position: relative; }

.walk-controls { margin: 20px 0; }
.btn-walk {
  width: 160px; height: 56px;
  border-radius: 28px;
  border: none;
  background: linear-gradient(135deg, var(--gold), #e6a000);
  color: #000;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(255,184,0,0.2);
  transition: all 0.2s;
}
.btn-walk.walking {
  background: linear-gradient(135deg, var(--red), #dc2626);
  color: #fff;
  box-shadow: 0 4px 24px rgba(239,68,68,0.2);
}
.btn-walk:active { transform: scale(0.95); }

.walk-stats-row {
  display: flex; gap: 10px; margin: 16px 0;
}
.ws-card {
  flex: 1;
  padding: 14px 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.ws-icon { font-size: 20px; }
.ws-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.ws-value { font-size: 16px; font-weight: 700; }

.daily-progress-bar { margin: 16px 0; }
.dpb-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text3); margin-bottom: 6px;
}
.dpb-track {
  height: 8px; background: rgba(255,255,255,0.04);
  border-radius: 8px; overflow: hidden;
}
.dpb-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 8px;
  transition: width 0.3s ease;
  min-width: 2px;
}

/* ─── WALLET ─── */
.wallet-hero {
  text-align: center; padding: 20px 0 24px;
}
.wallet-balance-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-bottom: 16px;
}
.wallet-icon { font-size: 40px; }
.wallet-balance {
  font-size: 42px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.wallet-label { font-size: 13px; color: var(--text3); }

.earning-row, .tx-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.er-left, .tx-body { flex: 1; display: flex; align-items: center; gap: 10px; }
.er-icon, .tx-icon { font-size: 18px; }
.er-title, .tx-title { font-size: 13px; font-weight: 600; }
.er-sub, .tx-date { font-size: 11px; color: var(--text3); }
.er-right, .tx-amount { font-size: 15px; font-weight: 700; }
.tx-body { flex-direction: column; align-items: flex-start; gap: 2px; }
.empty-state { padding: 24px 18px; text-align: center; color: var(--text3); font-size: 13px; }

/* ─── REWARDS ─── */
.wallet-chip {
  padding: 4px 14px; background: var(--gold-dim);
  border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--gold);
}
.rewards-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.reward-card {
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  text-align: center;
  display: flex; flex-direction: column; gap: 6px;
}
.reward-icon-row { margin-bottom: 4px; }
.reward-emoji { font-size: 36px; }
.reward-name { font-size: 13px; font-weight: 700; }
.reward-desc { font-size: 11px; color: var(--text3); }
.reward-price { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 16px; font-weight: 700; color: var(--gold); }
.btn-redeem {
  margin-top: 6px; padding: 8px; border: none; border-radius: 10px;
  font-size: 12px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all 0.2s;
}
.btn-avail {
  background: linear-gradient(135deg, var(--gold), #e6a000);
  color: #000;
}
.btn-locked {
  background: var(--bg2);
  color: var(--text3);
  cursor: not-allowed;
}

/* ─── PROFILE ─── */
.profile-hero { text-align: center; padding: 20px 0; }
.avatar {
  width: 64px; height: 64px; margin: 0 auto 10px;
  background: var(--card-bg); border: 2px solid var(--card-border);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.profile-email { font-size: 15px; color: var(--text2); }
.profile-joined { font-size: 12px; color: var(--text3); margin-top: 2px; }

.settings-list { padding: 4px 0; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  font-size: 14px;
}
.logout-row { color: var(--red); cursor: pointer; border-top: 1px solid rgba(255,255,255,0.03); margin-top: 8px; }
.goal-select {
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg2); color: var(--text);
  font-size: 13px; outline: none; font-family: inherit;
}

/* Toggle */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg3); border-radius: 24px; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 20px; height: 20px;
  left: 2px; bottom: 2px;
  background: var(--text2); border-radius: 50%; transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: #000; }

/* ─── TAB BAR ─── */
.tab-bar {
  display: flex; justify-content: space-around;
  padding: 8px 12px 24px;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
}
.tab-btn {
  background: none; border: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 12px;
  transition: all 0.2s;
}
.tab-icon { font-size: 20px; }
.tab-label { font-size: 10px; color: var(--text3); font-weight: 500; }
.tab-active .tab-icon { transform: scale(1.1); }
.tab-active .tab-label { color: var(--gold); font-weight: 700; }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 12px;
  font-size: 13px; font-weight: 600; z-index: 50;
  background: var(--bg3);
  border: 1px solid var(--card-border);
  white-space: nowrap;
}

/* ─── SVG Gradient Def ─── */
svg defs {
  display: none;
}
