:root {
  color-scheme: dark;
  font:
    14px/1.5 system-ui,
    sans-serif;
  color: #f2ece2;
  background: #15191c;
  --surface: #20262af5;
  --muted: #b4b4ac;
  --gold: #d29b72;
  --line: #394248;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
#viewport {
  position: fixed;
  inset: 0;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.map-card,
.developer-card {
  position: fixed;
  width: 264px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 36px #0003;
  max-height: calc(100dvh - 110px);
  overflow: auto;
  overscroll-behavior: contain;
}
.map-card {
  top: max(20px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
}
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  letter-spacing: 0.6px;
  font-weight: 750;
  line-height: 1.1;
  color: inherit;
  text-decoration: none;
}
.brand img {
  width: 40px;
  height: 30px;
  flex-shrink: 0;
}
.brand small {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 4px;
  font-weight: 500;
}
.map-heading {
  margin: 20px 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.mode-label {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
}
#view-mode {
  min-height: 42px;
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}
.menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
#full-screen {
  background: transparent;
  border-color: var(--line);
}
.menu-actions:has(#full-screen[hidden]) #photo-open {
  grid-column: 1 / -1;
}
.settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.settings-heading h2 {
  font:
    21px Georgia,
    serif;
}
#viewer-settings label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
  font-size: 12px;
}
#viewer-settings output {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
input[type='range'] {
  accent-color: var(--gold);
  padding: 0;
  min-height: 32px;
  cursor: pointer;
}
#settings-reset {
  width: 100%;
  margin-top: 20px;
  background: transparent;
}
#flight-prompt {
  position: fixed;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100% - 32px));
  padding: 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 48px #0004;
}
#start-fly {
  min-width: 120px;
  min-height: 44px;
  color: var(--gold);
  font-size: 16px;
}
#flight-prompt p {
  margin: 16px 0 8px;
  font-size: 13px;
}
#flight-prompt small {
  color: var(--muted);
}
#flight-hud {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  right: max(20px, env(safe-area-inset-right));
  display: grid;
  gap: 3px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  pointer-events: none;
  font-size: 11px;
  color: var(--muted);
}
#flight-speed {
  color: var(--gold);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
#map-north {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--gold);
  font-size: 12px;
  pointer-events: none;
}
.is-flying .map-card,
.is-flying .developer-card {
  visibility: hidden;
}
h1 {
  margin: 0;
  font:
    25px/1.2 Georgia,
    serif;
  overflow-wrap: anywhere;
}
h2 {
  margin: 0;
  font-size: 16px;
}
.row {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}
.row input,
.row select {
  width: 100%;
}
.row button {
  flex-shrink: 0;
}
.map-card .row button {
  flex: 1;
}
input,
select,
button {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #20262a;
  color: inherit;
  font: inherit;
}
button {
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
}
button:hover {
  border-color: var(--gold);
  background: #2a3237;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
canvas:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -3px;
}
label {
  display: block;
  margin: 12px 0 5px;
}
select,
input[type='range'] {
  width: 100%;
}
input[type='checkbox'] {
  width: auto;
  accent-color: var(--gold);
}
.navigation-help {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
summary {
  cursor: pointer;
}
.navigation-help p {
  margin: 10px 0 0;
}
kbd {
  display: inline-block;
  padding: 0 4px;
  margin-right: 2px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--gold);
  font:
    11px system-ui,
    sans-serif;
}
.touch-help {
  display: none;
}
.map-status {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: max(20px, env(safe-area-inset-left));
  max-width: calc(100% - 40px - env(safe-area-inset-left) - env(safe-area-inset-right));
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  pointer-events: none;
  box-shadow: 0 4px 20px #0003;
}
#status {
  margin: 0;
  color: #b4b4ac;
  font-size: 12px;
}
#map-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
#status:not([hidden]) + #map-counts:not([hidden]) {
  margin-top: 4px;
}
.map-fallback {
  position: fixed;
  top: 50%;
  left: 50%;
  max-width: calc(100% - 40px);
  margin: 0;
  padding: 20px;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.map-layers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.map-layers label,
#places-control {
  margin: 8px 0 0;
  font-size: 12px;
  cursor: pointer;
}
.map-layers small,
#places-state {
  display: block;
  color: var(--muted);
}
#claim-detail {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  overflow-wrap: anywhere;
}
#claim-owner {
  color: var(--muted);
}
#player-markers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.player-marker {
  position: absolute;
  top: 0;
  left: 0;
  padding: 3px 7px;
  border: 1px solid var(--gold);
  border-radius: 5px;
  background: #15191ce6;
  color: #f2ece2;
  font-size: 11px;
  white-space: nowrap;
}
.player-marker:after {
  content: '';
  position: absolute;
  left: calc(50% - 3px);
  bottom: -7px;
  width: 5px;
  height: 5px;
  border: 1px solid #15191c;
  border-radius: 50%;
  background: var(--gold);
}
.place-marker {
  max-width: 220px;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  border-color: #7bd8c0;
  text-overflow: ellipsis;
}
.place-marker:after {
  background: #7bd8c0;
}
.place-marker:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}
.follow-marker {
  pointer-events: auto;
  cursor: pointer;
}
.follow-marker:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}
#follow-control {
  margin-top: 10px;
}
#follow-player {
  margin: 0;
}
#waypoints {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.waypoint-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
#waypoints h2 {
  font-size: 14px;
}
#places-control {
  margin: 0;
}
#waypoint-search {
  width: 100%;
  font-size: 12px;
}
#waypoint-list {
  display: grid;
  gap: 6px;
  max-height: 240px;
  margin-top: 8px;
  overflow: auto;
}
.waypoint-entry {
  width: 100%;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.waypoint-entry small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
.waypoint-entry[aria-current='true'] {
  border-color: var(--gold);
}
.note {
  color: var(--muted);
  font-size: 12px;
}
.developer-card {
  top: 20px;
  right: 20px;
  width: 310px;
  font-size: 12px;
}
#selection {
  overflow-wrap: anywhere;
}
li {
  margin-bottom: 6px;
}
#menu-toggle {
  display: block;
  padding: 7px 9px;
  background: transparent;
  border-color: var(--line);
}
#menu-toggle::after {
  content: '⌄';
  margin-left: 5px;
  color: var(--gold);
}
#menu-toggle[aria-expanded='true']::after {
  content: '⌃';
}
[hidden] {
  display: none !important;
}
@media (pointer: coarse) {
  .pointer-help,
  .keyboard-help {
    display: none;
  }
  .touch-help {
    display: block;
  }
}
@media (max-width: 650px) {
  .map-card {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    width: min(250px, calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    padding: 14px;
    max-height: calc(100dvh - 110px);
  }
  .brand {
    font-size: 15px;
  }
  .map-heading {
    margin-top: 14px;
    padding-top: 12px;
  }
  h1 {
    font-size: 23px;
  }
  #menu-toggle {
    min-height: 36px;
  }
  button,
  input:not([type='checkbox']),
  select,
  summary {
    min-height: 44px;
  }
  .map-layers label,
  #places-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
  }
  .map-layers small {
    margin-left: 4px;
  }
  summary {
    display: flex;
    align-items: center;
  }
  input[type='search'],
  input[type='number'] {
    font-size: 16px;
  }
  #waypoint-list {
    max-height: 140px;
  }
  .place-marker {
    min-height: 44px;
  }
  .map-status {
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    max-width: calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }
  .developer-card {
    top: 12px;
    right: 12px;
    width: calc(100% - 24px);
  }
  #flight-hud {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
  }
}
.error-page {
  display: grid;
  min-height: 100dvh;
  padding: 24px;
  place-items: center;
}
.error-card {
  width: min(100%, 420px);
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.error-card h1 {
  margin-top: 32px;
  font-size: 32px;
}
.error-card p {
  color: var(--muted);
}
.error-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}
.error-action:hover {
  border-color: var(--gold);
  background: #2a3237;
}
.photo-panel {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  width: min(290px, calc(100% - 24px));
  max-height: calc(100dvh - 100px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 36px #0003;
}
.photo-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.photo-heading h2 {
  font:
    23px Georgia,
    serif;
}
.photo-panel label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.photo-panel output {
  color: var(--gold);
}
.photo-primary {
  width: 100%;
  margin: 12px 0;
  color: var(--gold);
}
.photo-cinematic {
  margin-top: 8px;
  font-size: 12px;
}
.photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
#photo-record-path,
#photo-video {
  grid-column: 1/-1;
}
#photo-message {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}
#photo-activity {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
}
.is-composing .map-card,
.is-composing .map-status,
.is-composing .developer-card,
.is-composing #player-markers,
.is-composing #map-north,
.is-composing #flight-hud {
  visibility: hidden;
}
.is-flying .photo-panel {
  visibility: hidden;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
@media (max-width: 650px) {
  .photo-panel {
    top: 12px;
    right: 12px;
  }
  #photo-activity {
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}
#place-description {
  white-space: pre-line;
  line-height: 1.5;
  margin: 0.65rem 0;
}
#place-credit {
  font-size: 0.8rem;
  color: var(--muted, #a9b8b0);
  margin: 0.5rem 0;
}
#place-image-link {
  display: block;
  margin: 0.75rem 0;
}
#place-image {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 6px;
}
#place-share {
  margin-top: 0.65rem;
}
#place-share-fallback {
  display: block;
  margin-top: 0.5rem;
}
#tour-controls {
  margin-top: 12px;
}
#tour-stop {
  display: block;
  margin-bottom: 8px;
  line-height: 1.5;
}
.tour-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
