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

:root {
  --bg: #000000;
  --bg-card: #16161f;
  --bg-tertiary: #0a0a0f;
  --text: #f2f5f7;
  --text-dim: #9aa4ad;
  --accent: #8ed0ff;
  --warn: #ffd479;
  --focus: #a5d8ff;
}

html, body { width: 100%; height: 100%; background: var(--bg); overflow: hidden; }
body { color: var(--text); font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

#app {
  width: 600px; height: 600px;
  transform-origin: 0 0;
  transform: scale(var(--app-scale, 1));
  position: relative;
}

.hidden { display: none !important; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

.header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 28px; background: var(--bg-tertiary);
}
.header h1 { font-size: 28px; font-weight: 700; }
.header-meta { margin-left: auto; color: var(--text-dim); font-size: 18px; }
.back-btn {
  background: none; border: 2px solid transparent; border-radius: 10px;
  color: var(--text); font-size: 26px; padding: 2px 12px; cursor: pointer;
}

.content { flex: 1; padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }

.hint { color: var(--text-dim); font-size: 20px; text-align: center; padding: 8px 0; }

.card { background: var(--bg-card); border-radius: 14px; padding: 18px 22px; }
.spot-card { text-align: center; }
.card-title { font-size: 24px; font-weight: 700; }
.card-value { font-size: 44px; font-weight: 700; color: var(--accent); padding: 6px 0; }
.card-subtitle { font-size: 17px; color: var(--text-dim); }

.nav-bar { padding: 14px 28px 22px; }
.nav-item {
  display: block; width: 100%;
  background: var(--bg-card); color: var(--text);
  border: 2px solid transparent; border-radius: 12px;
  font-size: 22px; font-weight: 600; padding: 14px; margin-top: 10px;
  text-align: center; cursor: pointer;
}
.nav-item.primary { background: var(--accent); color: #06131c; }

.focusable:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(165, 216, 255, 0.35);
}

.loading-container, .error-container { text-align: center; padding: 30px 0; }
.loading-spinner {
  width: 44px; height: 44px; margin: 0 auto 14px;
  border: 4px solid var(--bg-card); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text, .error-message { font-size: 20px; color: var(--text-dim); }
.error-icon { font-size: 40px; padding-bottom: 8px; }

#guide-live { text-align: center; }
#guide-arrow {
  font-size: 150px; line-height: 1.1;
  color: var(--accent);
  will-change: transform;
  display: inline-block;
}
#guide-distance { font-size: 52px; font-weight: 700; }
#guide-cue { font-size: 24px; color: var(--text-dim); padding-top: 4px; }
.badge-row { display: flex; justify-content: center; gap: 12px; padding-top: 14px; }
.badge {
  background: var(--bg-card); color: var(--text-dim);
  border-radius: 999px; font-size: 16px; padding: 4px 14px;
}
.badge.warn { color: var(--warn); }

#guide-degraded { text-align: center; padding-top: 40px; }
#degraded-distance { font-size: 52px; font-weight: 700; }

#guide-arrived { text-align: center; padding-top: 30px; }
.arrived-icon { font-size: 84px; }
.arrived-text { font-size: 40px; font-weight: 700; color: var(--accent); }

#debug {
  position: fixed; left: 6px; bottom: 6px; z-index: 99;
  font: 12px/1.5 ui-monospace, Menlo, monospace;
  color: #7fdc7f; background: rgba(0,0,0,0.75);
  padding: 6px 10px; border-radius: 8px; white-space: pre;
}
