:root {
  --bg-base: #0a0a1a;
  --bg-surface: #1a1a2e;
  --accent: #00d4ff;
  --accent-dim: #00d4ff33;
  --text-primary: #ffffff;
  --text-muted: #8888aa;
  --status-ok: #00ff88;
  --status-warn: #ffcc00;
  --status-err: #ff4444;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100dvh;
  overscroll-behavior: none;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.app-root {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.hero-speed {
  font-size: clamp(48px, 15vw, 96px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease-out;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-align: center;
}

.hero-secondary {
  font-size: clamp(18px, 5vw, 32px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--text-muted);
}

.label-text {
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.glow-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  transition: opacity 0.3s ease-out;
  pointer-events: none;
  z-index: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.ok   { background: var(--status-ok);   box-shadow: 0 0 8px var(--status-ok); }
.status-dot.warn { background: var(--status-warn); box-shadow: 0 0 8px var(--status-warn); animation: pulse-warn 1s ease-in-out infinite; }
.status-dot.err  { background: var(--status-err);  box-shadow: 0 0 8px var(--status-err); }

@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
.pulse-warn { animation: pulse-warn 0.5s ease-in-out; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toggle-pill {
  display: inline-flex;
  border: 1px solid var(--bg-surface);
  border-radius: 9999px;
  overflow: hidden;
}
.toggle-pill button {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.toggle-pill button.active {
  background: var(--accent);
  color: #000;
}
.toggle-pill button:not(.active) {
  background: var(--bg-surface);
  color: var(--text-muted);
}

.stat-card {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 10px 16px;
}

.permission-cta {
  width: 100%;
  padding: 18px 24px;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #000;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: transform 0.1s;
}
.permission-cta:active {
  transform: scale(0.97);
}

.calibration-spinner {
  width: 64px;
  height: 64px;
  border: 4px solid var(--accent-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.calibration-progress {
  height: 3px;
  background: var(--accent);
  transition: width 0.1s linear;
  position: absolute;
  bottom: 0;
  left: 0;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--bg-surface);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.share-btn:active {
  background: var(--bg-surface);
}
