@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --fw-900: #061F17;
  --fw-800: #0B3D2E;
  --fw-700: #0F5540;
  --fw-600: #177A5B;
  --fw-500: #1F9A73;
  --turf-500: #C9FF3A;
  --turf-400: #D8FF6B;
  --paper: #F4F2EC;
  --paper-2: #ECE8DE;
  --cream: #FAF8F2;
  --ink: #0A0B09;
  --ink-2: #2B2E2A;
  --mute: #6A6E66;
  --line-soft: rgba(10,11,9,0.08);
  --ok: #6BCB6B;
  --warn: #F2A81D;
  --err: #E85D4B;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  background: var(--paper);
}

.font-display { font-family: 'Space Grotesk', 'Inter', sans-serif; letter-spacing: -0.02em; }
.font-mono    { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.uppercase    { text-transform: uppercase; letter-spacing: 0.08em; }
.tabular      { font-variant-numeric: tabular-nums; }

.scroll-body {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll-body::-webkit-scrollbar { display: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.08s ease, opacity 0.15s;
  user-select: none;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--turf-500); color: var(--fw-900); padding: 16px 20px; border-radius: 999px; font-size: 16px; }
.btn-dark    { background: var(--fw-900); color: var(--paper); padding: 16px 20px; border-radius: 999px; font-size: 16px; }
.btn-ghost   { background: transparent; color: var(--ink); border: 1px solid var(--line-soft); padding: 14px 18px; border-radius: 999px; font-size: 15px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-family: 'Space Grotesk', sans-serif; font-weight: 500; background: rgba(10,11,9,0.06); color: var(--ink); white-space: nowrap; cursor: default; }
.chip-dark    { background: var(--fw-900); color: var(--paper); }
.chip-turf    { background: var(--turf-500); color: var(--fw-900); }
.chip-outline { background: transparent; border: 1px solid var(--line-soft); }

.hr { height: 1px; background: var(--line-soft); border: none; margin: 0; }

.tabbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: var(--fw-900);
  border-radius: 100px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(6,31,23,0.35);
  z-index: 50;
}
.tabbar button {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(244,242,236,0.6);
  height: 48px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.tabbar button.active { background: var(--turf-500); color: var(--fw-900); }

.avatar {
  border-radius: 50%;
  background: var(--fw-700);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.stat-big { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -0.04em; line-height: 0.95; }

.seg { display: flex; background: rgba(10,11,9,0.06); padding: 4px; border-radius: 999px; }
.seg button {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 12px;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--mute);
  cursor: pointer;
  transition: all 0.15s;
}
.seg button.active { background: var(--fw-900); color: var(--paper); }

.field { background: rgba(10,11,9,0.04); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.field label { font-family: 'Space Grotesk', sans-serif; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.field input, .field select { background: transparent; border: none; outline: none; font-family: 'Inter', sans-serif; font-size: 16px; color: var(--ink); padding: 0; width: 100%; }

.track { height: 4px; background: rgba(10,11,9,0.1); border-radius: 2px; position: relative; }
.track-fill { position: absolute; height: 100%; background: var(--fw-800); border-radius: 2px; }
.track-knob { position: absolute; top: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--turf-500); border: 3px solid var(--fw-900); transform: translateX(-50%); }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--paper); }

.course-art {
  background: radial-gradient(ellipse 60% 45% at 35% 60%, var(--fw-600) 0%, var(--fw-700) 40%, var(--fw-800) 80%);
  position: relative;
  overflow: hidden;
}
.course-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 38%, rgba(201,255,58,0.16) 0%, transparent 14%),
    radial-gradient(circle at 18% 22%, rgba(255,255,255,0.08) 0%, transparent 12%);
}

.map-bg {
  background:
    radial-gradient(ellipse 40% 30% at 20% 30%, rgba(31,154,115,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 75% 65%, rgba(31,154,115,0.30) 0%, transparent 60%),
    radial-gradient(ellipse 30% 25% at 55% 20%, rgba(31,154,115,0.20) 0%, transparent 60%),
    #E8E4D6;
  position: relative;
}
.map-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(10,11,9,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(10,11,9,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
.anim-slide-up { animation: slideUp 0.3s ease-out; }
.anim-fade-in  { animation: fadeIn  0.2s ease-out; }

.icn { stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Safe area insets */
.safe-bottom { padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom))); }
