:root {
  color-scheme: dark;
  background: #03060c;
  color: #f0f8ff;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --trace: #9ce3e5;
  --mute: #afc6d5;
}
* { box-sizing: border-box; }
html,body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
#viewport { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; background: #03060c; }
#space, #flight-frame, #labels { position: absolute; inset: 0; width: 100%; height: 100%; }
#space { display: block; touch-action: none; }
body[data-input=mouse] #space { cursor: grab; }
body[data-input=mouse] #space:active { cursor: grabbing; }
#labels, #flight-frame { pointer-events: none; }
#flight-frame { z-index: 5; }
body[data-travel=true] #labels { opacity: .20; }

.world-marker {
  position: absolute;
  display: block;
  width: 0;
  height: 0;
  color: var(--trace);
}
.world-marker::before {
  position: absolute;
  display: block;
  content: "";
  width: var(--line);
  height: 1px;
  background: #80b9c77a;
  transform: rotate(var(--line-turn));
  transform-origin: 0 0;
}
.world-marker::after {
  position: absolute;
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 100%;
  border: 1px solid currentColor;
  transform: translate(-50%, -50%);
  background: #071119;
}
.world-marker b {
  position: absolute;
  transform: translate(calc(var(--ox) - 50%),calc(var(--oy) - 50%));
  padding: 3px 6px;
  background: #06121bc7;
  border-radius: 3px;
  white-space: nowrap;
  line-height: 1.4;
  font-size: clamp(10px,1.5vmin,13px);
  font-weight: 550;
  letter-spacing: .05em;
  color: #dcf0fc;
  text-shadow: 0 1px 5px #000;
}
.world-marker[data-hover=true] b, .world-marker[data-selected=true] b {
  color: #fff;
  box-shadow: 0 0 0 1px #8af1e6, 0 0 15px #4ad3d044;
  background: #0d3740;
}
.world-marker[data-hover=true]::after, .world-marker[data-selected=true]::after { background: #a4fcf1; box-shadow: 0 0 14px #86ffed; }

#launch { position: absolute; left: max(16px,env(safe-area-inset-left)); bottom: max(18px,env(safe-area-inset-bottom)); }
button,select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid #99fbea; outline-offset: 3px; }
#camera-button {
  border: 1px solid #75c8c7;
  background: #09222bed;
  color: #d4fffc;
  border-radius: 20px;
  padding: 8px 15px;
  font-size: 13px;
}
#opening-help { color: #d2e5f2; font-size: 11px; margin: 7px 0 0; text-shadow: 0 2px 9px #000; }

#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 39px;
  height: 39px;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid #9ce3e59c;
  background: conic-gradient(#92f3e7 var(--fill,0deg),transparent 0);
  padding: 3px;
  pointer-events: none;
  z-index: 9;
}
#cursor i { display: block; position: relative; width: 100%; height: 100%; border-radius: 50%; background: #091923; }
#cursor i::after { content: ""; position: absolute; inset: 45%; border-radius: 50%; background: #edfeff; box-shadow: 0 0 9px #89eee9; }

#object-details {
  position: absolute;
  z-index: 2;
  left: var(--info-x,66%);
  top: var(--info-y,50%);
  transform: translateY(-34%);
  width: min(335px,calc(100% - 38px));
  padding: 3px 9px 8px 16px;
  border-left: 1px solid #8ae6dd;
  color: #e8f5ff;
  text-shadow: 0 2px 10px #000, 0 0 13px #01050a;
  background: linear-gradient(90deg,#03070eec,transparent);
  pointer-events: none;
}
#object-details::before {
  content: "";
  position: absolute;
  left: -35px;
  bottom: 0;
  width: 35px;
  height: 1px;
  transform-origin: right center;
  transform: rotate(-33deg);
  background: #8ae6dd;
}
#object-details h2 { margin: 3px 0 8px; font-size: clamp(20px,4.5vmin,37px); line-height: 1.13; overflow-wrap: anywhere; }
#object-details p { margin: 5px 0 8px; font-size: 13px; line-height: 1.55; color: #d1e4ee; }
#object-details .identity { font-size: 11px; color: #a5e0df; letter-spacing: .12em; }
#object-details dl { margin: 9px 0 0; display: grid; gap: 5px; }
#object-details dl div { display: grid; grid-template-columns: 7em 1fr; font-size: 11px; }
#object-details dt { color: #acbeca; }
#object-details dd { margin: 0; overflow-wrap: anywhere; }

#camera-preview {
  position: absolute;
  right: max(12px,env(safe-area-inset-right));
  bottom: max(14px,env(safe-area-inset-bottom));
  width: min(170px,38vw);
  aspect-ratio: var(--video-ratio,4/3);
  border: 1px solid #9ce3e5aa;
  border-radius: 6px;
  overflow: hidden;
  pointer-events: none;
  background: #020509;
}
#camera-preview[data-size=large] { width: min(310px,54vw); }
#camera-preview[data-size=hidden] { left: 0; top: 0; width: 1px; height: 1px; opacity: .001; border: 0; }
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; transform: scaleX(-1); }
#hand-bones { position: absolute; inset: 0; width: 100%; height: 100%; }
#camera-preview[data-size=bones] { background: #0510199c; border-color: #88d7cb57; }
#camera-preview[data-size=bones] #video { opacity: .001; }
#recognition-window { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: var(--roi,100%); height: var(--roi,100%); border: 1px dashed #9cf7ea; }

#flight-status, #scene-error, .launch-help {
  position: absolute;
  margin: 0;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 35px);
  text-align: center;
  color: #d8edf9;
  padding: 6px 11px;
  border-radius: 4px;
  background: #050b13de;
  border: 1px solid #9ce3e552;
  font-size: 12px;
  z-index: 6;
  pointer-events: none;
}
#flight-status { bottom: max(18px,env(safe-area-inset-bottom)); }
#scene-error,.launch-help { top: max(14px,env(safe-area-inset-top)); color: #ffe0bd; }

dialog {
  width: min(520px,calc(100% - 28px));
  max-height: 90dvh;
  border: 1px solid #557583;
  border-radius: 12px;
  background: #09131f;
  color: #eff7ff;
  padding: 22px;
}
dialog::backdrop { background: #02060bcc; }
dialog h2 { margin-top: 0; font-size: 23px; }
dialog p, dialog li { font-size: 13px; line-height: 1.65; }
dialog a, dialog output { color: #8df5e1; }
dialog form { float: right; }
dialog button, dialog select { border: 1px solid #5b7384; border-radius: 4px; background: #122737; padding: 5px 9px; margin: 2px; }
dialog label { display: block; margin: 14px 0; font-size: 14px; }
dialog input { accent-color: #74eeda; width: 100%; display: block; margin-top: 7px; }
dialog label output { float: right; }
@media (max-width: 650px) {
  #object-details { left: 14px; top: auto; bottom: max(12px,env(safe-area-inset-bottom)); transform: none; width: min(360px, calc(100% - 30px)); }
  #object-details::before { display: none; }
  #object-details p { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { #flight-frame { animation: none; } }


#camera-consent {
  --consent-surface:#0b1822; --consent-ink:#eef8fa; --consent-muted:#adc6cf;
  --consent-line:#385461; --consent-accent:#a6ebde;
  --consent-button:#a6ebde; --consent-button-ink:#0b1822;
}
.gesture-guide { width: 100%; border-collapse: collapse; font-size: 12px; }
.gesture-guide th,.gesture-guide td { text-align: left; padding: 7px; border-bottom: 1px solid #345260; }

#device-advice { display: none; }
@media (max-width: 600px), (max-width: 920px) and (max-height: 520px) and (orientation: landscape) {
  #device-advice {
    display: block;
    width: fit-content;
    max-width: calc(100vw - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right)));
    margin: 8px 0 0;
    padding: 8px 11px;
    border-inline-start: 3px solid #8deade;
    border-radius: 0 6px 6px 0;
    background: #0a202bea;
    color: #eefbff;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.5;
  }
}
