:root {
  --bg-primary: #000000;      /* pure black = transparent on the additive waveguide */
  --bg-secondary: #0a0a0f;    /* UI surfaces must emit light, so never #000 */
  --bg-card: #1c1e21;
  --text-primary: #ffffff;
  --text-secondary: #e4e6eb;
  --text-muted: #b0b3b8;
  --accent-primary: #9fd4ff;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --danger: #ff4466;
  --success: #00ff88;
  --radius-md: 12px;
}

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

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Opt in to the continuous pointer stream. Read from <body> once at load. */
  touch-action: none;
}

#app { width: 100%; height: 100%; position: relative; }

.screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
}
.screen.hidden { display: none; }
.hidden { display: none; }

.header {
  margin-top: 16px;
  height: 64px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.header h1 { font-size: 28px; font-weight: 700; }
.header-meta { font-size: 14px; color: var(--text-muted); }

.content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lede { font-size: 16px; line-height: 1.5; color: var(--text-secondary); }
.hint { font-size: 14px; line-height: 1.4; color: var(--text-muted); }

.stat-row { display: flex; gap: 12px; }
.stat {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 700; }

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text-muted);
}
.check-dot { font-size: 18px; line-height: 1; }
.check.ok { color: var(--text-primary); }
.check.ok .check-dot { color: var(--success); }

.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
}
.kv span { color: var(--text-muted); }
.mono { font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace; font-size: 14px; }

.nav-bar {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  padding: 8px;
}
.nav-item {
  flex: 1;
  height: 88px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.nav-item.primary { background: #24405a; }

.focusable { transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease; }
/* Focus is the entire input model, so it has to be unmistakable on an
   additive display where a thin border barely emits any light. */
.focusable:focus,
.focusable.focused {
  outline: none;
  border-color: var(--focus-ring);
  background: #2b4a63;
  box-shadow: 0 0 20px var(--focus-glow);
}
.nav-item.primary.focused { background: #2f5a7d; }
.focusable:active { border-color: var(--focus-ring); }

/* --- Flight screen --- */
#flight { padding: 0; }
#hud { position: absolute; top: 0; left: 0; width: 600px; height: 600px; }

.flight-controls {
  position: absolute;
  bottom: 16px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
}
.pill {
  min-width: 150px;
  height: 72px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(28, 30, 33, 0.85);
  border: 2px solid transparent;
  border-radius: 28px;
  cursor: pointer;
}

/* --- Toast --- */
.toast {
  position: absolute;
  bottom: 148px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 20px;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14px;
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--success); }
