@font-face {
  font-family: VazirLocal;
  src: url('../fonts/vazir.ttf') format('truetype');
  font-display: swap;
}
:root {
  color-scheme: dark;
  --paper: #f7f8fc;
  --surface: #ffffff;
  --action: #5865d8;
  --focus: #a9b4ff;
  --night: #080e20;
  --panel: #101a2d;
  --ink: #e7edf4;
  --muted: #91a1b8;
  --gold: #e9c991;
  --blue: #8fbddd;
  --line: #bacde21f;
  font-family: VazirLocal, Tahoma, sans-serif;
  color: var(--ink);
  background: var(--night);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
button {
  border: 0;
}
button:hover {
  filter: brightness(1.18);
}
[hidden] {
  display: none !important;
}
#universe,
#overlay,
.vignette {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
#universe {
  touch-action: none;
  background: radial-gradient(
    ellipse at 58% 45%,
    #17223a 0%,
    #0c1429 43%,
    #070c1b 100%
  );
}
#overlay,
.vignette {
  pointer-events: none;
}
.vignette {
  background:
    linear-gradient(90deg, #080e2088, transparent 37%),
    linear-gradient(0deg, #080e20cc, transparent 18%);
  box-shadow: inset 0 0 150px #04081555;
}
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 30px 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
header > * {
  pointer-events: auto;
}
.brand {
  display: flex;
  gap: 15px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  font-size: 46px;
  color: var(--gold);
}
.brand strong {
  font-family: VazirLocal, Tahoma, sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.1;
  display: block;
}
.brand small {
  display: block;
  font-size: 8px;
  margin-top: 9px;
  color: var(--muted);
}
.header-right {
  display: flex;
  gap: 24px;
  align-items: center;
}
.live {
  font-size: 10px;
  text-transform: uppercase;
  color: #b1bed0;
}
.live i {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #afd3c9;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 10px #afd3c9;
}
.icon-button {
  background: transparent;
  border: 1px solid var(--line);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 17px;
  color: #b7c6d6;
}
.intro {
  position: fixed;
  right: 44px;
  top: 160px;
  pointer-events: none;
}
.eyebrow {
  font-size: 9px;
  color: var(--gold);
  font-weight: 600;
}
h1 {
  font-family: VazirLocal, Tahoma, sans-serif;
  font-weight: 400;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.65;
  margin: 22px 0;
}
p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}
input {
  width: 100%;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--ink);
  font-size: 11px;
}
input::placeholder {
  color: #9aabc1;
}
kbd {
  font: 10px monospace;
  border: 1px solid #a3bdd33a;
  border-radius: 3px;
  padding: 3px 5px;
  color: #aebed0;
}
.panel {
  position: fixed;
  left: 34px;
  top: 130px;
  width: 286px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: linear-gradient(135deg, #19253bd9, #0c1428e8);
  backdrop-filter: blur(22px);
  box-shadow: 0 24px 70px #0003;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-heading .eyebrow {
  font-size: 8px;
}
.panel-heading button {
  border: 0;
  font-size: 22px;
  width: 24px;
  height: 24px;
}
.word-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
h2 {
  font-family: VazirLocal, Tahoma, sans-serif;
  font-weight: 400;
  font-size: 32px;
}
.word-heading h2 {
  font-family: VazirLocal, Tahoma, sans-serif;
  font-size: 38px;
  margin: 17px 0 6px;
  overflow-wrap: anywhere;
}
.star-symbol {
  font-size: 38px;
  color: var(--gold);
}
.coordinate-line {
  font:
    11px VazirLocal,
    Tahoma,
    sans-serif;
  color: var(--muted);
  margin: 5px 0 22px;
}
.primary {
  background: var(--gold);
  color: #222630;
  border-radius: 6px;
  padding: 12px 15px;
  width: 100%;
  text-align: start;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}
.primary span {
  font-size: 16px;
}
.neighbors-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 10px;
  font-size: 11px;
}
.neighbors-heading > span:last-child {
  font:
    10px VazirLocal,
    Tahoma,
    sans-serif;
  color: var(--muted);
}
.neighbor {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border-top: 1px solid var(--line);
  padding: 11px 0;
  width: 100%;
}
.neighbor .rank {
  font:
    11px VazirLocal,
    Tahoma,
    sans-serif;
  color: #71839d;
}
.neighbor .name {
  font-family: VazirLocal, Tahoma, sans-serif;
  font-size: 16px;
  flex: 1;
  text-align: start;
}
.neighbor .distance {
  font:
    11px VazirLocal,
    Tahoma,
    sans-serif;
  color: var(--muted);
}
.neighbor:first-child .name {
  color: var(--gold);
}
.neighbor:hover .name {
  color: var(--gold);
}
.panel-note {
  font-size: 9px;
  line-height: 1.8;
  margin-bottom: 0;
  color: #889ab1;
}
footer {
  position: fixed;
  bottom: 0;
  padding: 21px 42px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-top: 1px solid #a3bdd313;
  background: #080e2044;
}
.flight-help,
.view-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.flight-help {
  font-size: 10px;
  color: var(--muted);
}
.flight-help b {
  color: #55647a;
}
.text-button {
  background: none;
  color: var(--muted);
  font-size: 11px;
}
.text-button span {
  margin-left: 5px;
}
.crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  height: 18px;
  width: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border: 1px solid #d8e9f119;
  border-radius: 50%;
}
.crosshair span {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #d8e9f166;
  left: 7px;
  top: 7px;
}
#toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #c8d5e3;
  background: #101a2de8;
  border: 1px solid var(--line);
  padding: 12px 19px;
  border-radius: 25px;
  pointer-events: none;
  transition: opacity 0.4s;
  text-align: center;
  max-width: 85vw;
}
.mobile-controls {
  display: none;
}
dialog {
  width: min(480px, 90vw);
  max-height: 85dvh;
  overflow: auto;
  padding: 32px;
  background: #111c30;
  border: 1px solid #a3bdd344;
  border-radius: 15px;
  color: var(--ink);
  box-shadow: 0 30px 100px #0008;
}
dialog::backdrop {
  background: #020715b3;
  backdrop-filter: blur(8px);
}
#close-help {
  float: left;
}
dialog h2 {
  font-size: 30px;
  line-height: 1.2;
}
dialog p {
  font-size: 12px;
}
dl {
  font-size: 11px;
  line-height: 1.7;
}
dt {
  color: var(--gold);
  margin-top: 12px;
}
dd {
  margin: 3px 0;
  color: #aebed0;
}
dialog .primary {
  margin-top: 24px;
}

:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
header {
  padding-top: max(20px, env(safe-area-inset-top));
  padding-inline-start: max(24px, env(safe-area-inset-right));
  padding-inline-end: max(24px, env(safe-area-inset-left));
}
.brand small,
.live,
.eyebrow {
  font-size: 11px;
}
.brand small {
  margin-top: 5px;
}
.live i {
  margin-inline: 0 6px;
}
h1 {
  font-size: clamp(30px, 3.5vw, 48px);
  margin: 16px 0;
}
.intro p {
  font-size: 14px;
}
.icon-button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.panel-heading button {
  width: 44px;
  height: 44px;
}
.panel {
  max-height: calc(100dvh - 220px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.panel-heading .eyebrow {
  font-size: 11px;
}
.primary {
  font-size: 13px;
  min-height: 44px;
  align-items: center;
}
.neighbors-heading {
  gap: 12px;
}
.neighbor {
  min-height: 44px;
}
.neighbor .name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.neighbor .distance {
  white-space: nowrap;
}
.panel-note {
  font-size: 11px;
}
.coordinate-line {
  display: none;
}
.word-heading {
  gap: 12px;
}
.word-heading h2 {
  min-width: 0;
}
.star-symbol {
  flex-shrink: 0;
}
footer {
  padding-bottom: max(16px, var(--safe-bottom));
}
.flight-help {
  font-size: 12px;
  gap: 10px;
}
.text-button {
  min-height: 44px;
  font-size: 13px;
}
#toast {
  bottom: 90px;
  font-size: 12px;
}
body.has-selection #toast {
  visibility: hidden;
  opacity: 0 !important;
}
dialog h2 {
  line-height: 1.7;
}
dialog p,
dl {
  font-size: 13px;
}
dialog {
  padding: 24px;
}
@media (max-width: 1000px), (pointer: coarse) {
  header {
    padding: 12px 18px;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .brand {
    gap: 8px;
  }
  .brand-mark {
    font-size: 26px;
  }
  .brand strong {
    font-size: clamp(15px, 2.8vw, 20px);
    line-height: 1.5;
  }
  .brand small {
    font-size: 9px;
  }
  .header-right {
    gap: 10px;
  }
  .live {
    font-size: 10px;
  }
  .intro {
    top: 108px;
    right: 22px;
    left: 22px;
  }
  .intro .eyebrow {
    font-size: 10px;
  }
  h1 {
    font-size: 30px;
    margin: 10px 0;
  }
  .intro p {
    display: none;
  }
  .panel {
    top: auto;
    bottom: calc(208px + var(--safe-bottom));
    left: 16px;
    right: 16px;
    width: auto;
    max-height: min(42dvh, calc(100dvh - 300px));
    padding: 8px 14px;
  }
  .word-heading h2 {
    font-size: 22px;
    margin: 0 0 6px;
    line-height: 1.6;
  }
  .star-symbol {
    font-size: 24px;
  }
  .neighbors-heading {
    margin: 12px 0 4px;
  }
  .neighbor {
    padding: 6px 0;
  }
  .panel-note {
    margin-top: 8px;
  }
  .panel-heading .eyebrow {
    font-size: 10px;
  }
  .neighbor .name {
    font-size: 13px;
  }
  .neighbor .rank,
  .neighbor .distance {
    font-size: 10px;
  }
  .primary {
    font-size: 12px;
    padding: 9px 12px;
  }
  .primary span {
    font-size: 14px;
  }
  .panel-note {
    font-size: 10px;
  }
  .text-button {
    font-size: 11px;
  }
  dialog {
    padding: 18px;
  }
  dialog h2 {
    font-size: 21px;
    line-height: 1.6;
    margin: 16px 0;
  }
  dialog p,
  dl {
    font-size: 12px;
    line-height: 1.8;
  }
  dialog .eyebrow {
    font-size: 10px;
  }
  dialog .primary {
    margin-top: 16px;
  }
  body.has-selection .intro {
    display: none;
  }
  footer {
    padding: 6px 16px calc(6px + var(--safe-bottom));
  }
  .flight-help {
    display: none;
  }
  .view-controls {
    width: 100%;
    justify-content: space-between;
  }
  #toast {
    bottom: calc(211px + var(--safe-bottom));
    width: max-content;
    max-width: calc(100vw - 32px);
    font-size: 11px;
  }
  .mobile-controls {
    display: block;
    direction: ltr;
    user-select: none;
  }
  #joystick {
    position: fixed;
    bottom: calc(88px + var(--safe-bottom));
    left: max(24px, env(safe-area-inset-left));
    width: 104px;
    height: 104px;
    border-radius: 50%;
    border: 1px solid #afc7df44;
    background: radial-gradient(circle, #b8cfe509, #b8cfe502);
    touch-action: none;
  }
  #joystick:before,
  #joystick:after {
    content: '';
    position: absolute;
    background: #afc7df18;
  }
  #joystick:before {
    width: 70px;
    height: 1px;
    left: 16px;
    top: 51px;
  }
  #joystick:after {
    height: 70px;
    width: 1px;
    top: 16px;
    left: 51px;
  }
  #joystick-knob {
    position: absolute;
    left: 32px;
    top: 32px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #b9cbe51b;
    border: 1px solid #c4d7eb66;
    pointer-events: none;
  }
  .altitude {
    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: calc(115px + var(--safe-bottom));
    display: flex;
    gap: 12px;
  }
  .altitude button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #172237cc;
    border: 1px solid #afc7df44;
    font-size: 22px;
    touch-action: none;
  }
  .swipe-hint {
    position: fixed;
    bottom: calc(68px + var(--safe-bottom));
    left: 16px;
    right: 16px;
    text-align: center;
    font-size: 10px;
    color: var(--muted);
    direction: rtl;
  }
}
@media (max-width: 370px) {
  .brand small {
    display: none;
  }
  .live {
    font-size: 9px;
  }
  .header-right {
    gap: 6px;
  }
  .panel {
    left: 10px;
    right: 10px;
  }
}
@media (max-height: 600px) and (min-width: 600px) {
  .intro {
    display: none;
  }
  .panel {
    top: 80px;
    bottom: calc(66px + var(--safe-bottom));
    left: auto;
    right: max(16px, env(safe-area-inset-right));
    width: min(300px, 44vw);
    max-height: none;
  }
  .altitude {
    right: auto;
    left: 150px;
    bottom: calc(105px + var(--safe-bottom));
  }
  .swipe-hint {
    right: auto;
    width: 260px;
  }
  .live {
    display: none;
  }
  #toast {
    left: 150px;
    max-width: 260px;
    bottom: calc(211px + var(--safe-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
