:root {
  color-scheme: dark;
  --ink: #eef0eb;
  --muted: #a2aeb0;
  --line: #a7c2c329;
  --accent: #a8e4d6;
  --pad: 52px;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #080b0e;
  color: var(--ink);
  font: 15px/1.6 Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, summary, input, select { font: inherit; }
button, summary { color: inherit; cursor: pointer; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
#app, .scrim { position: fixed; inset: 0; }
#app canvas { width: 100%; height: 100%; display: block; cursor: grab; }
#app canvas:active { cursor: grabbing; }
.scrim {
  pointer-events: none;
  background:
    linear-gradient(90deg, #080b0ef0 0%, #080b0ec4 19%, #080b0e5e 38%, transparent 63%),
    linear-gradient(0deg, #080b0efc 0%, #080b0eb5 13%, transparent 31%);
}

.station {
  position: fixed;
  z-index: 3;
  inset: 0 var(--pad) auto;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}
.brand, .station-actions, summary { display: flex; align-items: center; }
.brand { gap: 14px; }
.station-mark {
  width: 32px;
  height: 32px;
  position: relative;
  border: 1px solid #a8e4d678;
  border-radius: 50%;
}
.station-mark::before, .station-mark::after { content: ""; position: absolute; }
.station-mark::before { inset: 10px -4px; border: 1px solid var(--accent); border-radius: 50%; transform: rotate(-36deg); }
.station-mark::after { inset: 12px; border-radius: 50%; background: var(--accent); }
.brand-name { display: grid; line-height: 1.35; gap: 3px; }
.brand-name strong { font-weight: 600; }
.brand-name span, .catalog, .dock-heading, .target-label small {
  font: 11px/1.4 var(--mono);
  color: var(--muted);
}
.station-actions { pointer-events: auto; }
details { position: relative; }
summary {
  list-style: none;
  gap: 9px;
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 4px;
  background: #0c1216c9;
  font-size: 12px;
}
summary::-webkit-details-marker { display: none; }
summary:hover, details[open] summary { border-color: #a8e4d688; }
.settings-icon {
  width: 14px;
  height: 12px;
  position: relative;
  background: linear-gradient(currentColor, currentColor) 0 2px / 100% 1px no-repeat,
              linear-gradient(currentColor, currentColor) 0 9px / 100% 1px no-repeat;
}
.settings-icon::before, .settings-icon::after { content: ""; position: absolute; width: 3px; height: 5px; background: currentColor; }
.settings-icon::before { left: 4px; top: 0; }
.settings-icon::after { right: 3px; bottom: 0; }
.settings-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(290px, calc(100vw - 32px));
  max-height: min(420px, calc(100dvh - 74px));
  overflow: auto;
  padding: 14px 16px;
  background: #10171bee;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 32px #0008;
  backdrop-filter: blur(16px);
}
.setting { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; }
.setting input { margin: 0; accent-color: var(--accent); }
.setting input[type="range"] { width: 105px; }
.setting select { background: #161e21; color: var(--ink); border: 1px solid var(--line); border-radius: 3px; padding: 2px 6px; }
fieldset { margin: 8px 0 0; padding: 2px 0 0; border: 0; border-top: 1px solid var(--line); min-inline-size: 0; }
legend { padding-right: 8px; color: var(--muted); font-size: 11px; }

.observation {
  position: fixed;
  left: var(--pad);
  top: 46%;
  transform: translateY(-45%);
  width: min(36%, 430px);
  pointer-events: none;
}
.catalog { display: flex; align-items: center; gap: 10px; }
#catalog-id { color: var(--accent); border: 1px solid #a8e4d658; padding: 2px 6px; border-radius: 2px; }
#object-name { font-size: 66px; font-weight: 650; line-height: 1.14; margin: 16px 0 0; text-wrap: balance; }
.latin { color: var(--accent); font: italic 28px/1.35 "Instrument Serif", Georgia, serif; margin: 7px 0 18px; }
.description { color: #c0c9c9; max-width: 290px; margin: 0; line-height: 1.8; }
.readings { display: flex; gap: 22px; margin: 23px 0; }
.readings > div { padding-left: 11px; border-left: 1px solid #a8e4d655; }
.readings dt { color: var(--muted); font-size: 11px; }
.readings dd { font: 19px/1.3 var(--mono); margin: 3px 0 0; }
.object-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.object-actions button {
  pointer-events: auto;
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: #101a1edb;
  border-radius: 4px;
  font-size: 13px;
}
.object-actions button:hover { border-color: var(--accent); }
.object-actions #primary { background: var(--accent); color: #102321; border-color: var(--accent); font-weight: 650; }
.object-actions #primary:hover { background: #c5f0e6; }
.object-actions #primary[aria-pressed="false"] { background: #101a1edb; color: var(--accent); border-color: var(--line); }
.object-actions #primary[aria-pressed="false"]:hover { border-color: var(--accent); }
.object-actions #primary[aria-pressed="false"] .pulse-icon { box-shadow: none; background: transparent; }
.pulse-icon, .color-swatch { width: 13px; height: 13px; flex: none; border-radius: 50%; }
.pulse-icon { border: 1px solid currentColor; box-shadow: inset 0 0 0 3px var(--accent); background: currentColor; }
.color-swatch { background: var(--swatch, #00c2ff); border: 1px solid #fff6; }
#secondary[data-mode="reset"] .color-swatch {
  background: none;
  border: 1px solid currentColor;
  border-right-color: transparent;
}
.view-status {
  position: fixed;
  top: 112px;
  right: var(--pad);
  max-width: min(280px, calc(100% - 2 * var(--pad)));
  padding: 7px 12px;
  color: var(--ink);
  background: #11191dea;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
}

.dock { position: fixed; inset: auto var(--pad) 31px; }
.dock-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.dock-heading > span { font-size: 12px; color: var(--ink); }
.targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.targets button {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  text-align: left;
  border: 1px solid var(--line);
  background: #0d1318d9;
  border-radius: 5px;
  padding: 6px 12px 6px 6px;
}
.targets button:hover { background: #172127f5; }
.targets button[aria-current="true"] { border-color: #a8e4d67d; background: #132421df; }
.target-art { width: 68px; height: 54px; background-size: cover; background-position: center; border-radius: 3px; }
.target-core { background-image: url("./assets/core-preview.webp"); }
.target-planet { background-image: url("./assets/planet-preview.webp"); }
.target-moon { background-image: url("./assets/moon-preview.webp"); }
.static-view #app {
  background: var(--preview) 78% 43% / min(61vw, 86dvh) auto no-repeat;
}
.static-view, .static-view[data-target="core"] { --preview: url("./assets/core-preview.webp"); }
.static-view[data-target="planet"] { --preview: url("./assets/planet-preview.webp"); }
.static-view[data-target="moon"] { --preview: url("./assets/moon-preview.webp"); }
.target-label { display: grid; gap: 3px; }
.target-label strong { font-size: 14px; font-weight: 600; }
.target-arrow { color: var(--accent); opacity: .55; }
[aria-current="true"] .target-arrow { opacity: 1; }

@media (max-width: 1100px) {
  :root { --pad: 34px; }
  #object-name { font-size: 51px; }
}
@media (max-width: 720px) {
  :root { --pad: 18px; }
  .station { height: 63px; }
  .brand { gap: 10px; }
  .brand-name span { font-size: 9px; }
  .station-mark { width: 25px; height: 25px; }
  .station-mark::before { inset: 8px -3px; }
  .station-mark::after { inset: 9px; }
  .scrim { background: linear-gradient(0deg, #080b0e 3%, #080b0efa 19%, #080b0eb8 34%, transparent 59%); }
  .observation { top: auto; bottom: 104px; transform: none; width: calc(100% - 2 * var(--pad)); }
  #object-name { font-size: 42px; margin-top: 7px; }
  .latin { font-size: 21px; margin: 1px 0 9px; }
  .description { max-width: 340px; font-size: 13px; line-height: 1.55; }
  .readings { margin: 11px 0; gap: 16px; }
  .readings dd { font-size: 16px; }
  .object-actions button { min-height: 36px; }
  .dock { bottom: 13px; }
  .dock-heading { margin-bottom: 5px; }
  .targets { gap: 5px; }
  .targets button { grid-template-columns: 29px minmax(0, 1fr); min-height: 53px; padding: 5px; gap: 5px; }
  .target-art { width: 29px; height: 34px; }
  .target-label { gap: 2px; }
  .target-label small { font-size: 9px; }
  .target-label strong { font-size: 11px; line-height: 1.35; }
  .target-arrow { display: none; }
  .view-status { top: 72px; }
  .static-view #app { background-position: center 21%; background-size: min(100vw, 51dvh) auto; }
}
@media (max-height: 690px) and (min-width: 721px) {
  .station { height: 62px; }
  .dock { bottom: 15px; }
  .observation { top: 45%; }
  #object-name { font-size: 50px; margin-top: 8px; }
  .latin { margin-bottom: 10px; }
  .readings { margin: 14px 0; }
}
@media (max-width: 720px) and (max-height: 680px) {
  .description { display: none; }
  #object-name { font-size: 34px; }
}
@media (max-height: 480px) {
  .station { height: 49px; }
  .observation { top: auto; bottom: 94px; transform: none; }
  #object-name { font-size: 31px; margin-top: 4px; }
  .latin { font-size: 19px; margin: 0 0 5px; }
  .description { display: none; }
  .readings { margin: 6px 0; }
  .object-actions button { min-height: 34px; }
  .dock { bottom: 7px; }
  .targets button { min-height: 44px; }
  .target-art { height: 33px; }
  .view-status { top: 57px; }
}
