/* ============================================
   Leo Fit PWA — Global Style Sheet
   Design tokens from mockupy_ui analysis
   ============================================ */

:root {
  --green: #99cc33;
  --green-glow: rgba(153, 204, 51, 0.35);
  --green-dim: rgba(153, 204, 51, 0.12);
  --bg: #121815;
  --surface: #1e2a24;
  --surface-2: #2a3b32;
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.45);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;
  --font: 'Poppins', sans-serif;
  --nav-height: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

/* ---- Screen ---- */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
  animation: fadeIn 0.2s ease;
}
.screen.active { display: flex; }

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

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 398px;
  background: rgba(30, 42, 36, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.nav-btn {
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.nav-btn.active {
  background: var(--green);
  color: #121815;
  box-shadow: 0 0 16px var(--green-glow);
}
.nav-btn:not(.active):hover { color: var(--green); }

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* ---- Progress Ring ---- */
.ring-wrap { position: relative; display: inline-flex; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

/* ---- Progress Bar ---- */
.progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--green-glow);
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
}

/* ---- Inputs ---- */
.input-field {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus { border-color: var(--green); }

/* ---- Buttons ---- */
.btn-primary {
  width: 100%;
  background: var(--green);
  color: #121815;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 15px 24px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 4px 16px var(--green-glow);
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }

/* ---- PIN inputs ---- */
.pin-grid {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.pin-digit {
  width: 48px; height: 60px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
  caret-color: var(--green);
}
.pin-digit:focus { border-color: var(--green); }

/* ---- Leaderboard rows ---- */
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: background 0.15s;
  cursor: pointer;
}
.lb-row:hover { background: rgba(255,255,255,0.04); }
.lb-row.lb-me { background: var(--green-dim); border: 1px solid rgba(153,204,51,0.25); }
.lb-avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--green);
  flex-shrink: 0;
}

/* ---- Reward item ---- */
.reward-item {
  display: flex; align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.reward-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  background: var(--green-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--green);
  flex-shrink: 0;
}

/* ---- Tab switcher ---- */
.tab-bar {
  display: flex;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}
.tab-btn {
  flex: 1;
  padding: 10px;
  border: none; border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--green);
  color: #121815;
  box-shadow: 0 2px 12px var(--green-glow);
}

/* ---- Utility ---- */
.material-symbols-outlined { font-size: 24px; user-select: none; }
.icon-fill { font-variation-settings: 'FILL' 1; }
section { padding: 0 16px; }
h2 { font-size: 1.25rem; font-weight: 700; }
.muted { color: var(--text-muted); font-size: 0.8rem; }
.green { color: var(--green); }
.scroll-area { flex: 1; overflow-y: auto; padding-bottom: 8px; }
.scroll-area::-webkit-scrollbar { width: 0; }

/* ---- Splash ---- */
.splash-bg {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(153,204,51,0.35) 0.5px, transparent 0.5px);
  background-size: 28px 28px;
}
