:root {
  --bg: #000000;
  --surface: rgba(28, 30, 33, 0.78);
  --surface-strong: rgba(28, 30, 33, 0.92);
  --text: #ffffff;
  --secondary: #e4e6eb;
  --muted: #b0b3b8;
  --cyan: #77f7ff;
  --cyan-strong: #26f0ff;
  --green: #42f5a7;
  --yellow: #f7d95d;
  --orange: #ff9d4d;
  --danger: #ff5b6e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 600px;
  height: 600px;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button {
  border: 0;
  font: inherit;
  color: inherit;
}

.glasses-shell,
.screen {
  width: 600px;
  height: 600px;
}

.screen {
  display: none;
  position: relative;
  padding: 24px;
  overflow: hidden;
}

.screen.active {
  display: block;
}

.focusable {
  opacity: 0.82;
  transition: transform 300ms ease, opacity 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
}

.focusable:focus {
  outline: none;
  opacity: 1;
  transform: scale(0.94);
  box-shadow: 0 0 22px rgba(38, 240, 255, 0.42);
}

.pin-panel {
  height: 552px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand,
.label,
.hud-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 6px 0 18px;
  font-size: 28px;
  line-height: 1.1;
}

.pin-display {
  width: 390px;
  height: 72px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

.pin-display span {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: var(--surface);
  font-size: 30px;
  font-weight: 800;
}

.keypad {
  width: 360px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.key,
.demo-button,
.action-button,
.icon-button,
.stop-button {
  min-height: 64px;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.key {
  font-size: 24px;
}

.key.accent,
.action-button.primary {
  color: #051010;
  background: var(--cyan);
}

.key.muted {
  color: var(--muted);
}

.demo-button {
  width: 360px;
  margin-top: 12px;
  min-height: 56px;
  color: var(--secondary);
}

.top-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  height: 78px;
}

.icon-button {
  width: 72px;
  height: 72px;
  font-size: 28px;
}

.route-card {
  margin-top: 24px;
  padding: 22px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.metric-big {
  font-size: 54px;
  font-weight: 900;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.metrics-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.metrics-row strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.status-message {
  margin-top: 20px;
  min-height: 52px;
  color: var(--secondary);
  font-size: 16px;
}

.bottom-actions {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.action-button {
  height: 88px;
  font-size: 20px;
}

.run-screen {
  padding: 0;
}

#route-canvas {
  position: absolute;
  inset: 0;
  width: 600px;
  height: 600px;
}

.hud-distance {
  position: absolute;
  left: 86px;
  top: 84px;
  min-width: 210px;
  font-size: 34px;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.legend {
  margin-top: 22px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.8;
  font-weight: 800;
}

.legend span {
  display: inline-block;
  width: 18px;
  height: 8px;
  margin-right: 8px;
  border-radius: 8px;
}

.legend-you {
  background: var(--green);
}

.legend-ghost {
  margin-left: 0;
  background: rgba(255, 255, 255, 0.55);
}

.hud-pace {
  position: absolute;
  right: 82px;
  top: 92px;
  min-width: 130px;
  padding: 10px 20px;
  border: 2px solid rgba(247, 217, 93, 0.52);
  border-radius: 12px;
  background: rgba(28, 30, 33, 0.35);
  color: var(--yellow);
  text-align: center;
  font-size: 26px;
  font-weight: 900;
}

.ahead-badge {
  position: absolute;
  left: 50%;
  bottom: 168px;
  min-width: 238px;
  transform: translateX(-50%);
  padding: 12px 18px;
  border: 2px solid rgba(66, 245, 167, 0.74);
  border-radius: 12px;
  background: rgba(28, 30, 33, 0.64);
  color: var(--green);
  text-align: center;
  font-size: 26px;
  font-weight: 900;
}

.ahead-badge.behind {
  color: var(--orange);
  border-color: rgba(255, 157, 77, 0.74);
}

.hud-bottom {
  position: absolute;
  bottom: 86px;
  font-size: 28px;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.hud-bottom.left {
  left: 128px;
}

.hud-bottom.right {
  right: 118px;
}

.too-far {
  position: absolute;
  left: 70px;
  right: 70px;
  top: 232px;
  padding: 22px;
  border: 2px solid rgba(255, 91, 110, 0.75);
  border-radius: 12px;
  background: rgba(28, 30, 33, 0.9);
  text-align: center;
}

.too-far strong,
.too-far span {
  display: block;
}

.too-far strong {
  color: var(--danger);
  font-size: 30px;
  margin-bottom: 8px;
}

.too-far span {
  color: var(--secondary);
  font-size: 16px;
}

.stop-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 88px;
  height: 56px;
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: absolute;
  left: 50%;
  top: 24px;
  max-width: 520px;
  transform: translateX(-50%);
  padding: 14px 20px;
  border-radius: 24px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 16px;
  text-align: center;
  z-index: 5;
}

.hidden {
  display: none;
}
