:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #334155;
  --primary: #3b82f6;
  --primary-dim: #1d4ed8;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --text: #f8fafc;
  --text-dim: #94a3b8;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface2);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar .logo { font-size: 20px; font-weight: 700; }
.topbar .points {
  margin-left: auto;
  background: var(--surface2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar .points .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.topbar .free-bage {
  background: var(--amber);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
}
.topbar .avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface2); }

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card h3 { font-size: 14px; color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }

select, button {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2394a3b8' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
select:focus, button:focus { outline: none; border-color: var(--primary); }

.btn-primary { background: var(--primary); border-color: var(--primary); font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--primary-dim); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-green { background: var(--green); border-color: var(--green); color: #000; font-weight: 700; font-size: 18px; }
.btn-green:hover { filter: brightness(0.9); }
.btn-red { background: var(--red); border-color: var(--red); font-weight: 700; }

.btn-outline { background: transparent; border-color: var(--surface2); color: var(--text-dim); cursor: pointer; }

.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80dvh;
  text-align: center;
  gap: 24px;
  padding: 32px;
}
.login-screen h1 { font-size: 28px; }
.login-screen p { color: var(--text-dim); line-height: 1.5; }
.login-screen .google-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: #fff;
  color: #333;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.login-screen .google-btn svg { width: 20px; height: 20px; }

.locked-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60dvh;
  text-align: center;
  gap: 16px;
}
.locked-screen .icon { font-size: 48px; }
.locked-screen h2 { font-size: 22px; }
.locked-screen p { color: var(--text-dim); max-width: 360px; line-height: 1.5; }

.community-banner {
  background: linear-gradient(135deg, var(--primary-dim), #7c3aed);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.community-banner .stat { text-align: center; flex: 1; }
.community-banner .stat .num { font-size: 24px; font-weight: 700; }
.community-banner .stat .label { font-size: 11px; color: rgba(255,255,255,0.7); }

#map { height: 300px; border-radius: var(--radius); margin-bottom: 12px; background: var(--surface2); }

.bus-list { list-style: none; }
.bus-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--surface2);
}
.bus-item:last-child { border-bottom: none; }
.bus-item .dest { font-weight: 600; }
.bus-item .eta { margin-left: auto; color: var(--green); font-weight: 600; font-size: 14px; }
.bus-item .dist { color: var(--text-dim); font-size: 12px; }
.bus-item .badge {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}

.contrib-status {
  text-align: center;
  padding: 24px;
}
.contrib-status .big-icon { font-size: 64px; margin-bottom: 12px; }
.contrib-status h2 { margin-bottom: 4px; }
.contrib-status .detail { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; }
.contrib-status .points-earned {
  font-size: 40px;
  font-weight: 700;
  color: var(--green);
  margin: 12px 0;
}
.contrib-status .stop-btn { max-width: 200px; margin: 16px auto; }

.empty { text-align: center; color: var(--text-dim); padding: 32px; }

@media (max-width: 400px) {
  .topbar { padding: 8px 12px; }
  .container { padding: 12px; }
  #map { height: 220px; }
}
