:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #111920;
  color: #f0f5f7;
}
body { margin: 0; }
main {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(1rem, 5vw, 2.5rem);
  text-align: center;
}
h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.5rem); letter-spacing: -.05em; }
.intro { color: #b6c5cc; margin: .5rem 0 1.3rem; }
#view {
  height: clamp(12rem, 44svh, 24rem);
  border: 1px solid #334953;
  border-radius: 1.25rem;
  background: radial-gradient(ellipse at center, #1e3944, #121e27 70%);
  touch-action: none;
  cursor: grab;
}
#view:active { cursor: grabbing; }
canvas { display: block; width: 100%; height: 100%; }
#direction { margin: 1rem 0 .25rem; font-size: 1.3rem; font-weight: 700; }
#bearing, #status, #observer { color: #b6c5cc; margin: .4rem 0; }
.controls { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin: 1.2rem 0 .8rem; }
button {
  border-radius: .65rem;
  border: 1px solid #496371;
  background: #223641;
  color: inherit;
  font: inherit;
  font-weight: 600;
  padding: .55rem .95rem;
  min-height: 44px;
  cursor: pointer;
}
#motion { background: #f5a34a; border-color: #f5a34a; color: #1b1b1b; }
:focus-visible { outline: 2px solid #8de1e6; outline-offset: 4px; }
button:disabled { opacity: .65; cursor: wait; }

#manual-location { max-width: 29rem; margin: 1.3rem auto 0; text-align: left; }
.location-entry { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }
.location-entry input {
  flex: 1 1 14rem;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: .55rem .7rem;
  border: 1px solid #496371;
  border-radius: .65rem;
  background: #172630;
  color: inherit;
  font: inherit;
}
#place-status { margin: .5rem 0; }
#place-status:empty { margin: 0; }
#place-results { list-style: none; padding: 0; margin: .5rem 0; }
#place-results li + li { margin-top: .4rem; }
#place-results button { width: 100%; text-align: left; }
#manual-location small { color: #b6c5cc; }
#manual-location a { color: #8de1e6; }

#desktop-warning {
  margin: 0 0 1.25rem;
  padding: .85rem 1rem;
  border: 1px solid #f5a34a;
  border-radius: .75rem;
  background: #382917;
  color: #fff0db;
}
#desktop-warning strong { display: block; color: #ffce92; }
#desktop-warning span { display: block; margin-top: .2rem; }

#viewer { position: relative; }
#fullscreen { position: absolute; z-index: 3; top: .5rem; right: .5rem; width: 44px; padding: 0; font-size: 1.6rem; background: #14232ddd; }
#viewer:fullscreen, #viewer.expanded { width: 100%; height: 100%; background: #121e27; }
#viewer.expanded { position: fixed; inset: 0; height: 100dvh; z-index: 9999; }
body.viewer-expanded { overflow: hidden; }
#viewer:fullscreen #view, #viewer.expanded #view { height: 100%; width: 100%; border: 0; border-radius: 0; }
#viewer:fullscreen #fullscreen, #viewer.expanded #fullscreen { top: max(.5rem, env(safe-area-inset-top)); right: max(.5rem, env(safe-area-inset-right)); }
#viewer:fullscreen #direction, #viewer.expanded #direction { position: absolute; bottom: calc(2rem + env(safe-area-inset-bottom)); left: 0; right: 0; margin: 0; pointer-events: none; text-shadow: 0 1px 4px #000; }
#viewer:fullscreen #bearing, #viewer.expanded #bearing { position: absolute; bottom: calc(.6rem + env(safe-area-inset-bottom)); left: 0; right: 0; margin: 0; pointer-events: none; text-shadow: 0 1px 4px #000; }
