:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #f3f6ff;
  background: #05070e;
  --muted: #b7c3da;
  --ice: #a8c9ff;
  --border: rgb(185 209 255 / .24);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, canvas:focus-visible, a:focus-visible {
  outline: 2px solid #c8ddff;
  outline-offset: 4px;
}

.experience {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 340px;
  overflow: hidden;
  background: #05070e;
}

#sky, .shade, .map { position: absolute; inset: 0; width: 100%; height: 100%; }
#sky { display: block; touch-action: none; }
.exploring #sky { cursor: grab; }
.exploring #sky:active { cursor: grabbing; }
.shade, .map { pointer-events: none; }
.shade {
  background: radial-gradient(ellipse at 50% 42%, transparent 36%, #03050c55 100%),
              linear-gradient(0deg, #03050cbf, transparent 26%);
}
.exploring .shade {
  background: linear-gradient(0deg, #03050ccc, transparent 29%),
              linear-gradient(180deg, #03050c98, transparent 23%);
}

.top {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(20px, 4vw, 45px) clamp(20px, 5vw, 68px);
  pointer-events: none;
}
.top button, .map button { pointer-events: auto; }
.map-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.top-actions { display:flex; align-items:flex-start; justify-content:flex-end; gap:8px; }
.language-picker { max-inline-size:min(11rem, 46vw); pointer-events:auto; color-scheme:dark; cursor:pointer; }
.invite-header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .22em;
}
.orbit-mark {
  position: relative;
  flex: none;
  width: 25px;
  height: 25px;
  border: 1px solid #b9d3ffbf;
  border-radius: 50%;
}
.orbit-mark::before {
  content: "";
  position: absolute;
  inset: 8px -5px;
  border: 1px solid #b9d3ffbf;
  border-radius: 50%;
  transform: rotate(-30deg);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--ice);
  font-size: 12px;
  letter-spacing: .19em;
}
.intro-controls {
  position: absolute;
  inset: auto clamp(20px, 5vw, 68px) clamp(22px, 5vw, 58px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.intro-caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0 6vw clamp(83px, 16vh, 170px);
  background: linear-gradient(0deg, #03050d80, #03050d25 29%, transparent 52%);
  pointer-events: none;
  opacity: 0;
}
.intro-caption-text { width: min(100%, 1090px); }
.intro-caption p {
  margin: 0;
  color: #f4f0e5;
  font-family: DengXian, "等线", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(15px, 1.67vw, 22px);
  line-height: 1.55;
  text-align: center;
  text-wrap: pretty;
  text-shadow: 0 2px 9px #02040d, 0 0 22px #a8b8ed88;
}
.intro-caption p[lang="en"] {
  margin: 8px auto 0;
  max-width: 900px;
  color: #d4e0fa;
  font-family: "French Script MT", "Segoe Script", "Snell Roundhand", "Apple Chancery", cursive;
  font-size: clamp(19px, 2.55vw, 31px);
  line-height: 1.14;
}
.timeline { width: min(37vw, 285px); }
.time {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  font: 12px/1.4 "IBM Plex Mono", Consolas, monospace;
  color: var(--muted);
}
.track { height: 2px; overflow: hidden; background: #d8e8ff3d; }
.track div { width: 100%; height: 100%; background: #c9ddff; transform: scaleX(0); transform-origin: left; }
.quiet-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #e3ecff;
  background: #0913269c;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 9px 14px;
  font-size: 12px;
  white-space: nowrap;
}
.quiet-button:hover, .map-controls button:hover { background: #172948e6; border-color: #b2caff75; }

.map-caption { position: absolute; inset-inline-start: clamp(20px, 5vw, 68px); bottom: clamp(22px, 5vw, 58px); max-inline-size: calc(100% - 182px); }
.map-caption h1 { margin: 0 0 8px; font-weight: 550; font-size: clamp(22px, 3vw, 36px); letter-spacing: .1em; }
.map-caption p { margin: 0; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.map-controls {
  position: absolute;
  inset-inline-end: clamp(20px, 5vw, 68px);
  bottom: clamp(22px, 5vw, 58px);
  display: flex;
  gap: 7px;
}
.map-controls button {
  width: 41px;
  height: 41px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: #e3ecff;
  background: #091326b8;
  font-size: 21px;
  line-height: 1;
}
.aim { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #d4e5ff; }
#sky:focus-visible ~ .map .aim { display: block; }

.selection {
  z-index: 2;
  position: absolute;
  inset-block-end: 108px;
  inset-inline-end: clamp(20px, 5vw, 68px);
  width: min(320px, calc(100% - 40px));
  max-height: calc(100% - 170px);
  overflow: auto;
  padding: 24px;
  background: #0a1324ed;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 15px 60px #03040eb3;
  backdrop-filter: blur(14px);
  animation: appear .2s ease both;
}
.close {
  position: absolute;
  top: 10px;
  inset-inline-end: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #dce7ff;
  font-size: 23px;
}
.close:hover { background: #dce7ff25; }
.selection .eyebrow { margin-bottom: 8px; }
.selection h2, .account-dialog h2 { margin: 0 0 7px; margin-inline-end:21px; font-size: 26px; font-weight: 550; overflow-wrap: anywhere; }
.selection p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.selection .coordinates { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 11px; margin: 0 0 12px; color: var(--ice); }
.fly-to { margin: 0 0 9px; }
.action {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #d8e6ff;
  border-radius: 9px;
  padding: 10px 12px;
  background: #d2e2ff;
  color: #101c31;
  font-size: 13px;
  font-weight: 600;
}
.action:hover { background: #edf4ff; }
button:disabled { cursor: default; opacity: .62; }
.selection form label, .account-dialog label { display: block; font-size: 13px; margin: 11px 0 8px; }
.selection input, .account-dialog input, .journal-dialog textarea {
  width: 100%;
  padding: 9px;
  color: #f3f6ff;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #060d1a;
}
.selection .form-hint { font-size: 11px; margin: 6px 0 10px; }
.claim-message { color: #c4deff; margin-bottom: 0; }
.account-dialog {
  width: min(390px, calc(100% - 36px));
  max-height: calc(100% - 36px);
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #0a1324;
  color: #f3f6ff;
  box-shadow: 0 15px 60px #03040eb3;
}
.account-dialog::backdrop { background: #03050cad; backdrop-filter: blur(4px); }
.account-dialog .action { margin-top: 17px; }
.account-dialog .form-hint, .account-dialog .claim-message {
  font-size: 13px;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.account-dialog .form-hint { color: var(--muted); }
.owned-planet-name { font-size: 20px; overflow-wrap: anywhere; }
.text-button {
  border: 0;
  padding: 0;
  margin-top: 15px;
  color: var(--ice);
  background: none;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.journal-dialog { width: min(490px, calc(100% - 36px)); }
.journal-dialog .eyebrow { margin: 8px 0 16px; letter-spacing: .07em; overflow-wrap: anywhere; }
.journal-dialog .field-hint { color: var(--muted); font-size: 12px; margin: -3px 0 8px; }
.journal-dialog textarea { display: block; resize: vertical; line-height: 1.6; }
.journal-dialog .reflection-toggle { display:flex; align-items:center; gap:7px; color:var(--ice); }
.journal-dialog .reflection-toggle input { width:auto; margin:0; accent-color:#a8c9ff; }
.public-reflection { border-top:1px solid var(--border); margin:13px 0; padding-top:12px; }
.public-reflection h3 { margin:0 0 7px; color:var(--ice); font-size:13px; }
.public-reflection p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.search-results { display:grid; gap:7px; margin-top:10px; }
.search-results button { white-space:normal; text-align:start; overflow-wrap:anywhere; }
[dir="rtl"] #planet-coordinates, [dir="rtl"] #signed-in-email { text-align:right; }
[dir="rtl"] .wordmark, [dir="rtl"] .map-caption h1, [dir="rtl"] .map-caption p { letter-spacing:normal; }
.journal-share { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 16px; }
.invite-link-controls { display: flex; gap: 8px; }
.invite-link-controls input { min-width: 0; font-size: 12px; }
.invite-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 30px 20px;
  background:
    radial-gradient(1px 1px at 14px 29px, #a9bbef96, transparent 140%) 0 0 / 89px 97px,
    radial-gradient(1px 1px at 43px 51px, #dfd5ff80, transparent 140%) 0 0 / 127px 117px,
    radial-gradient(ellipse at 68% 26%, #302756, transparent 55%),
    radial-gradient(ellipse at 15% 80%, #14213e, transparent 49%),
    #05070e;
}
.invite-card {
  width: min(530px, 100%);
  padding: clamp(25px, 7vw, 52px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #0a1324ed;
  box-shadow: 0 15px 60px #03040eb3;
}
.invite-card h1 { margin: 26px 0 20px; font-size: clamp(26px, 6vw, 42px); overflow-wrap: anywhere; }
.invite-card .eyebrow { margin-bottom: 8px; }
.invite-wish {
  margin: 0;
  padding-inline-start: 13px;
  border-inline-start: 1px solid var(--border);
  color: #e3ecff;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.invite-description { margin: 22px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.invite-card .action { text-decoration: none; }
.unavailable { inset: 50% auto auto 50%; transform: translate(-50%, -50%); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 600px) {
  .map-nav { gap: 5px; }
  .map-nav .quiet-button { padding-inline: 9px; }
  .map-caption { bottom: 24px; }
  .map-caption p { max-width: 175px; line-height: 1.6; }
  .map-controls { gap: 5px; bottom: 26px; }
  .map-controls button { width: 36px; height: 36px; }
  .selection { bottom: 90px; }
}
@media (max-width: 760px) {
  .top-actions { flex-direction:column-reverse; align-items:flex-end; gap:5px; }
}
@media (max-width: 450px) {
  .exploring .top { gap: 8px; padding-inline: 16px; }
  .exploring .wordmark { font-size: 12px; gap: 8px; letter-spacing: .08em; white-space: nowrap; }
  .exploring .orbit-mark { width: 19px; height: 19px; }
  .exploring .orbit-mark::before { inset-block: 6px; }
  .map-nav .quiet-button { font-size: 11px; padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .selection { animation: none; }
}
