.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.top span {
  font-size: 11px;
  color: #afbdd2;
}
.panel {
  position: fixed;
  z-index: 8;
  inset: 80px auto 20px 5%;
  width: min(430px, 90%);
  overflow: auto;
  border: 1px solid #475d7e;
  border-radius: 18px;
  padding: 25px;
}
.panel:empty {
  display: none;
}
h1 {
  font-size: 27px;
  margin: 5px 0 15px;
}
p {
  line-height: 1.7;
  color: #c3cedf;
}
label {
  display: block;
  margin: 16px 0 7px;
}
input,
textarea {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
}
.button,
button {
  cursor: pointer;
  padding: 11px 15px;
  font: inherit;
  text-decoration: none;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
.primary {
  border: 0;
}
.avatars {
  display: flex;
}
.avatars label {
  margin: 0;
  cursor: pointer;
}
.avatars img {
  height: 46px;
  display: block;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.error {
  color: #b2cef9;
}
#planet-nav {
  position: fixed;
  top: 64px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 7px;
  overflow: auto;
  padding: 8px;
  scrollbar-width: none;
}
#planet-nav[hidden],
body[data-view="form"] #app,
body[data-view="form"] #mode,
body[data-view="form"] .labels,
body[data-view="form"] > canvas {
  display: none;
}
#planet-nav button {
  white-space: nowrap;
  font-size: 12px;
}
#guide {
  position: fixed;
  left: 16px;
  right: 16px;
  pointer-events: none;
}
#guide p {
  font-size: 12px;
  max-width: 460px;
  text-shadow: 0 2px 4px #000;
}
#guide button {
  pointer-events: auto;
  margin-right: 8px;
}
.spot {
  padding: 0;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  pointer-events: auto;
  touch-action: manipulation;
}
.spot.occupied {
  width: 34px;
  height: 34px;
  border: 2px solid #96bcf6;
  overflow: hidden;
}
.spot img {
  width: 100%;
  height: 100%;
}
dialog {
  color: #fff;
  width: min(360px, 86vw);
  padding: 24px;
}
dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(4px);
}
dialog img {
  width: 65px;
}
.poster-image {
  border-radius: 8px;
}
.panel.poster {
  inset: 75px auto 15px 50%;
  transform: translateX(-50%);
  width: min(430px, 94vw);
}
.loader {
  z-index: 7;
  pointer-events: none;
}
a {
  color: #a5c6f8;
}
@media (max-width: 600px) {
  .top {
    padding: 18px 15px;
  }
  .top span {
    max-width: 135px;
    text-align: right;
  }
  .panel {
    padding: 22px;
    inset: 76px 5% 20px;
  }
  .top b {
    font-size: 14px;
  }
  #guide {
    bottom: max(18px, env(safe-area-inset-bottom));
  }
}
body[data-view="form"] {
  overflow: auto;
}
body[data-view="form"] .panel {
  width: min(480px, 100% - 32px);
  margin: 90px auto 32px;
}
body[data-view="form"] .panel,
body[data-view="form"] .panel.poster {
  position: relative;
  inset: auto;
  transform: none;
  box-sizing: border-box;
  overflow: visible;
}
#guide,
.top {
  z-index: 6;
}
.spot {
  width: 26px;
  height: 26px;
  border: 5px solid #ffffff60;
  background-clip: padding-box;
}
@media (max-width: 600px) {
  h1 {
    font-size: 25px;
  }
  .actions > * {
    flex: 1 1 100%;
    text-align: center;
  }
  #guide button {
    font-size: 12px;
    padding: 10px;
    margin: 3px;
  }
  #guide p {
    margin: 4px;
  }
}
.avatars label {
  position: relative;
  border: 1px solid transparent;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.avatars input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.avatars label:focus-within {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
body[data-view="form"] .panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 24px 12px;
  max-width: 440px;
}
h1 {
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.3;
}
body[data-view="form"] h1 {
  color: #4c8ef0;
  font-size: clamp(30px, 8vw, 40px);
  margin: 0 0 30px;
}
.top {
  background: linear-gradient(#090e16eb, transparent);
}
.top b {
  letter-spacing: 0.08em;
}
.top small {
  color: #4c8ef0;
}
label {
  color: #c4d8f6;
  font-size: 13px;
  margin-top: 22px;
}
input,
textarea {
  font-size: 16px;
  background: #4c8ef00b;
  border: 1px solid #4c8ef036;
  border-radius: 14px;
  color: #fff3eb;
  padding: 14px;
  outline: none;
}
input::placeholder {
  color: #708bb4;
}
textarea::placeholder {
  color: #708bb4;
}
input:focus-visible {
  border-color: #4c8ef0;
  box-shadow: 0 0 0 3px #4c8ef01a;
}
textarea:focus-visible {
  border-color: #4c8ef0;
  box-shadow: 0 0 0 3px #4c8ef01a;
}
select:focus-visible {
  border-color: #4c8ef0;
  box-shadow: 0 0 0 3px #4c8ef01a;
}
.primary {
  background: #3e85ef;
  color: #051124;
  border-color: transparent;
  padding: 15px 20px;
  font-weight: 750;
}
.primary:hover {
  background: #68a0f3;
}
#start,
.planet-picker {
  width: 100%;
}
.avatars label:has(input:checked) {
  background: #3e85ef30;
}
.hint {
  font-size: 11px;
  line-height: 1.6;
}
#planet-nav button {
  border-radius: 20px;
  padding: 10px 15px;
}
#guide button {
  background: #081324ed;
}
.spot {
  background-color: #fff8f3;
  box-shadow: 0 0 12px #4c8ef080;
}
.spot.occupied {
  border-color: #4c8ef0;
  background: #0e2c59;
}
dialog {
  border: 1px solid #4c8ef040;
  border-radius: 24px;
}
@media (max-width: 600px) {
  .panel.poster {
    padding: 12px;
  }
}
input:autofill {
  color: #0c1c35;
}
input:-webkit-autofill {
  -webkit-text-fill-color: #fff1e5;
  -webkit-box-shadow: inset 0 0 0 1e3px #101e32;
}
.poster-actions > * {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin: 0;
  padding: 12px 8px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 12px;
  text-align: center;
}
.poster-actions #download {
  grid-column: 1/-1;
}
.poster-actions #next-person {
  grid-column: 1/-1;
  background: transparent;
  color: #88a8d9;
  border-color: transparent;
}
#guide {
  margin: 0 auto;
}
#guide p {
  flex: 0 0 100%;
  margin: 0 0 4px;
}
#guide button {
  min-height: 44px;
  text-align: center;
}

body[data-view="form"] .brand-heading {
  font-family: Arial, sans-serif;
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 500;
  letter-spacing: 0.11em;
  margin-bottom: 8px;
  color: #fff1e5;
  white-space: nowrap;
}
.brand-subtitle {
  font-size: 13px;
  letter-spacing: 0.24em;
  color: #80aff5;
  margin: 0 0 30px;
}

html {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body[data-view="space"] {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body[data-view="form"] {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;
  touch-action: auto;
}
body[data-view="form"] .panel,
body[data-view="form"] .panel.poster {
  margin-top: calc(82px + env(safe-area-inset-top, 0px));
  margin-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  min-width: 0;
}
.poster-image {
  display: block;
  max-width: 100%;
}
.poster-actions {
  min-width: 0;
}
.poster-actions > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

body[data-view="inspect"],
body[data-view="picker"] {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

body[data-view="inspect"] {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 80% 0, #0e2444, #090e16 65%);
}
body:not([data-view="space"]) .labels,
body[data-view="inspect"] #mode,
body[data-view="picker"] #mode {
  display: none;
}
.inspect-actions,
.inspect-heading,
.picker-heading {
  text-align: center;
}
.inspect-heading small,
.picker-heading small {
  color: #6fa4f3;
  letter-spacing: 0.24em;
  font-size: 11px;
}
.picker-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 35px;
  margin: 4px 0 16px;
}
.picker-controls button {
  min-width: 48px;
  min-height: 44px;
}
.quiet {
  font-size: 13px;
  min-height: 44px;
}
.planet-inspector {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 70px auto 0;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
.inspect-heading h1 {
  margin: 6px 0;
  font-size: 30px;
}
#planet-stage {
  height: clamp(230px, 44dvh, 480px);
  position: relative;
  width: 100%;
  overflow: hidden;
}
#planet-stage canvas {
  touch-action: none;
  width: 100%;
  height: 100%;
}
.aim-guide {
  width: 74px;
  height: 74px;
  border: 1px solid #fff1e51c;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.inspect-actions {
  display: grid;
  gap: 5px;
  padding: 0 24px;
  max-width: 420px;
  margin: auto;
}
#target-name {
  min-height: 28px;
  font-size: 16px;
  overflow-wrap: anywhere;
}
#planet-status {
  margin: 0 0 8px;
  min-height: 18px;
}
dialog .actions {
  display: flex;
  flex-direction: column;
}
dialog .actions > * {
  width: 100%;
  min-height: 48px;
  flex: auto;
}
@media (max-height: 650px) {
  .planet-picker {
    margin-top: 64px;
  }
  #planet-stage {
    height: 230px;
  }
}
[hidden],
body:not([data-view="space"]) > .labels,
body:not([data-view="space"]) > .ui,
body:not([data-view="space"]) > canvas {
  display: none !important;
}
body[data-view="space"] > canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
body[data-view="picker"] {
  min-height: 100dvh;
}
body[data-view="picker"]:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.planet-picker {
  max-width: none;
  min-height: calc(100dvh - 80px);
  margin: 80px auto 0;
  padding-bottom: 25px;
  position: relative;
  overflow: hidden;
}
.picker-heading {
  position: relative;
  z-index: 2;
}
.section-code {
  font-size: 10px;
  letter-spacing: 0.24em;
}
.picker-heading h1 {
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 500;
  letter-spacing: 0.18em;
  margin: 10px 0;
}
.destination-stage {
  height: clamp(330px, 52dvh, 570px);
  position: relative;
  perspective: 1200px;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.destination-stage.dragging {
  cursor: grabbing;
}
.stage-orbit {
  position: absolute;
  width: 1100px;
  height: 240px;
  border: 1px solid #5d97ef1e;
  border-radius: 50%;
  top: 38%;
  left: 50%;
  transform: translateX(-50%) rotate(-12deg);
  pointer-events: none;
}
.destination-card {
  --offset: 0;
  --distance: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(245px, 32vw, 400px);
  height: 92%;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translate(
      calc(-50% + var(--offset) * 86% + var(--drag, 0px)),
      -50%
    )
    rotateY(calc(var(--offset) * -16deg))
    scale(calc(1 - var(--distance) * 0.14));
  opacity: calc(1 - var(--distance) * 0.36);
  z-index: calc(5 - var(--distance));
  transition:
    transform 0.65s cubic-bezier(0.22, 0.7, 0.15, 1),
    opacity 0.5s;
}
.dragging .destination-card {
  transition: opacity 0.2s;
}
.portal-outline {
  position: absolute;
  inset: 0 1%;
  clip-path: polygon(50% 0, 95% 20%, 95% 80%, 50% 100%, 5% 80%, 5% 20%);
  pointer-events: none;
}
.portal-outline:after {
  content: "";
  position: absolute;
  inset: 2px;
  clip-path: inherit;
}
.destination-card.selected:after {
  content: "";
  position: absolute;
  inset: 12px 7%;
  border-top: 1px solid #70a4f166;
  border-bottom: 1px solid #70a4f166;
  clip-path: polygon(50% 0, 100% 20%, 100% 80%, 50% 100%, 0 80%, 0 20%);
  pointer-events: none;
}
.destination-no {
  position: relative;
  font-size: 9px;
  letter-spacing: 0.26em;
}
.destination-world {
  position: relative;
  margin: 4px 0;
}
.destination-world img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.destination-card.selected .destination-world {
  animation: planet-hover 7s ease-in-out infinite;
}
.saturn-world:after {
  content: "";
  position: absolute;
  left: -10%;
  top: 30%;
  width: 120%;
  height: 34%;
  border: 9px double #8ba4ca99;
  border-radius: 50%;
  transform: rotate(-28deg);
  pointer-events: none;
}
.destination-en {
  position: relative;
  font-size: clamp(15px, 2vw, 25px);
  color: #bad3f9;
}
.destination-card strong {
  position: relative;
  font-size: clamp(17px, 2.2vw, 25px);
  letter-spacing: 0.15em;
  font-weight: 500;
}
.destination-info {
  text-align: center;
  margin: 14px auto 18px;
  padding: 0 20px;
  position: relative;
}
#planet-count {
  font-size: 11px;
  color: #73a6f2;
  letter-spacing: 0.2em;
}
#destination-copy {
  font-size: 12px;
  color: #8797ae;
  margin: 8px 0;
}
.destination-dock {
  display: grid;
  grid-template-columns: 48px minmax(0, 280px) 48px;
  gap: 16px;
  justify-content: center;
  padding: 0 20px;
}
.destination-dock button {
  border-radius: 5px;
  min-height: 50px;
}
#enter-planet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  letter-spacing: 0.12em;
  box-shadow: 0 0 30px #3b83ef24;
}
.destination-pagination {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 22px 0 10px;
}
.destination-pagination button {
  padding: 0;
  width: 18px;
  height: 3px;
  min-height: 3px;
  border-radius: 0;
}
.picker-secondary {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}
.avatars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.avatars label {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px;
  aspect-ratio: 1;
  border-radius: 16px;
}
.avatars img {
  width: 100%;
  height: auto;
  max-width: 72px;
}
.avatars label:has(input:checked) {
  box-shadow:
    0 0 0 2px #74a7f4,
    0 0 24px #3e85ef33;
}
dialog .actions .primary {
  order: -1;
}
#guide {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 420px;
  bottom: max(12px, env(safe-area-inset-bottom));
}
#guide button {
  flex: initial;
  min-height: 40px;
  font-size: 12px;
  margin: 0;
  border-radius: 6px;
}
#guide #space-checkin {
  font-size: 14px;
}
.space-target-caption {
  display: grid;
  gap: 5px;
  text-align: center;
  padding-bottom: 3px;
}
.space-target-caption small {
  font-size: 8px;
  letter-spacing: 0.2em;
  color: #6c89b4;
}
.space-target-caption strong {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.07em;
}
.space-tools {
  display: flex;
  gap: 6px;
}
#guide .space-tools button {
  white-space: nowrap;
  padding: 7px 8px;
}
#guide #back-form {
  min-height: 32px;
}
.spot:not(.occupied) {
  background: transparent;
  border: 1px solid #a7c7f8;
  box-shadow: none;
  border-radius: 3px;
  width: 28px;
  height: 28px;
}
.spot.targeted:not(.occupied):after {
  content: "";
  position: absolute;
  inset: 10px;
  background: #76a8f4;
  border-radius: 50%;
}
.spot.targeted {
  box-shadow:
    0 0 0 5px #74a7f420,
    0 0 24px #3e85ef55;
}
@keyframes planet-hover {
  50% {
    transform: translateY(-7px);
  }
}
@media (max-width: 600px) {
  .planet-picker {
    margin-top: 70px;
    min-height: calc(100dvh - 70px);
  }
  .destination-stage {
    height: clamp(320px, 48dvh, 460px);
  }
  .destination-card {
    width: 70vw;
    max-width: 310px;
    transform: translate(
        calc(-50% + var(--offset) * 82% + var(--drag, 0px)),
        -50%
      )
      rotateY(calc(var(--offset) * -22deg))
      scale(calc(1 - var(--distance) * 0.18));
  }
  .destination-dock {
    gap: 10px;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    max-width: 400px;
    margin: auto;
  }
  #guide {
    max-width: 360px;
    padding: 12px 12px 4px;
    gap: 7px;
  }
  #planet-nav {
    top: 53px;
  }
  #planet-nav button {
    padding: 8px 12px;
    font-size: 10px;
  }
}
@media (max-height: 700px) {
  .destination-stage {
    height: 310px;
  }
  .destination-info {
    margin: 6px auto 10px;
  }
  .destination-pagination {
    margin: 14px 0 6px;
  }
  .destination-world {
    width: 65%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .destination-card {
    transition: none;
  }
  .destination-card.selected .destination-world {
    animation: none;
  }
}

.picker-secondary {
  gap: 12px;
  margin: 22px auto 0;
  max-width: 620px;
  padding: 0 16px;
}
.picker-secondary .quiet {
  flex: 1 1 145px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid #437ed6;
  background: #182538;
  color: #d7e6fc;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: inset 0 1px #8eb8f640;
}
.picker-secondary .quiet:hover {
  background: #1d3f71;
  border-color: #71a5f4;
  outline: 2px solid #71a5f4;
  outline-offset: 3px;
}
.picker-secondary .quiet:focus-visible {
  background: #1d3f71;
  border-color: #71a5f4;
  outline: 2px solid #71a5f4;
  outline-offset: 3px;
}
body[data-browse-only="true"] #space-checkin,
body[data-browse-only="true"] #space-find-free {
  display: none !important;
}
body[data-browse-only="true"] #back-form {
  border: 1px solid #71a5f4;
  font-weight: 700;
  min-height: 48px;
}
body[data-browse-only="true"] .spot {
  pointer-events: none;
}
.overview-fallback {
  padding: 30px 16px 230px;
  max-width: 850px;
  margin: auto;
  text-align: center;
}
.overview-planets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.overview-planets figure {
  margin: 0;
}
.overview-planets img {
  width: 100%;
}
@media (max-width: 540px) {
  .overview-planets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .picker-secondary .quiet {
    flex-basis: 40%;
    font-size: 14px;
  }
}
.panel.poster .poster-actions > * {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
}
.panel.poster .poster-actions #next-person {
  border: 1px solid #3964a4;
}
#guide #back-form {
  min-height: 44px;
}
#guide .space-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  flex: none;
  align-items: center;
}
#guide .space-tools button {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
#guide .space-tools button[hidden] {
  display: none;
}
#guide,
#planet-nav {
  flex-wrap: nowrap;
}
body[data-browse-only="true"] .spot.occupied {
  pointer-events: auto;
}
body[data-view="space"]:has(.overview-fallback) {
  height: auto;
  overflow: auto;
}
#planet-nav {
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  z-index: 20;
  padding-right: 16px;
}
.poster-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.poster-actions > * {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
}
.avatars img {
  filter: none;
}
.button,
.destination-pagination button[aria-current="true"],
.panel,
.panel.poster,
button,
dialog {
  box-shadow: none;
}
.button,
button {
  border-color: #397bb5;
}
.button.primary,
button.primary {
  font-weight: 700;
}
.poster-image {
  width: 100%;
  height: auto;
  max-height: none;
}
body:before,
body[data-view="picker"]:before {
  background: none;
  opacity: 0;
}
.panel,
dialog {
  background: #0b0d10;
}
#guide,
.panel,
dialog {
  backdrop-filter: none;
  border-color: #ffffff30;
}
.panel.poster {
  background: transparent;
  border: 0;
}
.button,
button {
  background: transparent;
  border: 1px solid #ffffff55;
  color: #fff;
  border-radius: 3px;
}
.button:hover,
button:hover {
  background: #ffffff14;
  border-color: #fff;
}
.picker-secondary button,
.quiet {
  background: transparent !important;
  border-color: #ffffff40 !important;
  color: #e5e7eb !important;
}
.portal-outline {
  background: #ffffff22;
  filter: none !important;
}
.portal-outline:after {
  background: #080a0d;
}
.destination-card.selected:after,
body[data-browse-only="false"] #guide #overview,
body[data-browse-only="false"] #guide #routes {
  display: none;
}
.destination-card {
  border: 0;
}
.destination-card,
.destination-card:hover {
  background: transparent;
}
.stage-orbit {
  border-color: #ffffff0c;
}
.destination-en {
  font-family: Arial, sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
}
.destination-info,
.destination-no,
.hint,
.section-code {
  color: #9da8b4;
}
.destination-pagination button {
  background: #515961;
  border: 0;
}
#planet-nav button {
  background: #090b0ee8;
  color: #d9dfe5;
  border-color: #ffffff40;
}
body[data-browse-only="true"] #back-form {
  background: #f4f5f6;
  border-color: #fff;
  color: #07090c;
}

.poster-actions .quiet,
.poster-actions a,
.poster-actions button {
  border-radius: 3px !important;
}
#next-person {
  background: transparent !important;
  border-color: #ffffff55 !important;
  color: #ddd !important;
}

body {
  --space-accent: #087fe8;
  --space-accent-border: #70caff;
  --space-text: #f4f8fc;
}
body,
body[data-view="form"] {
  background: #030916;
  color: var(--space-text);
}
body[data-view="picker"],
body[data-view="poster"] {
  color: var(--space-text);
}
body[data-view="poster"] {
  background: #030916;
}
body[data-view="picker"] {
  background: radial-gradient(
    ellipse at 50% 42%,
    #0a2540,
    #040e20 42%,
    #030916 75%
  );
}
.button.primary,
button.primary {
  background: var(--space-accent);
  color: #fff;
  border-color: var(--space-accent-border);
  box-shadow: 0 0 24px #087fe81c;
}
.button.primary:hover,
button.primary:hover {
  background: #249afb;
  color: #fff;
}
.destination-card.selected .portal-outline {
  filter: none;
  background: linear-gradient(155deg, #a4e2ff, #214a6a33 40%, #239ae0);
}
.destination-card.selected .portal-outline:after {
  background: linear-gradient(155deg, #08121f, #050b12 65%, #0a2136);
}
.destination-card.selected .destination-en,
.destination-card.selected strong {
  color: #f1f9ff;
}
.destination-pagination button[aria-current="true"] {
  background: #91dfff;
}
#planet-nav button[aria-pressed="true"] {
  background: var(--space-accent);
  color: #fff;
  border-color: var(--space-accent-border);
}

#guide {
  background: linear-gradient(145deg, #0b2033f5, #07111ef5);
  border: 1px solid #87c9ff26;
  border-radius: 20px;
  padding: 18px;
  gap: 14px;
  box-shadow: 0 18px 50px #0008;
}
#guide .space-target-caption {
  gap: 6px;
  padding-bottom: 2px;
}
#guide .space-target-caption small {
  color: #a2bfd5;
  font-size: 10px;
  letter-spacing: 0.18em;
}
#guide .space-target-caption strong {
  color: #f3f8ff;
  font-size: 16px;
}
#guide .space-tools {
  gap: 6px;
  padding: 5px;
  border-radius: 13px;
  background: #020a1466;
  grid-auto-rows: 46px;
}
#guide .space-tools button {
  height: 46px;
  max-height: 46px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #dcecff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}
#guide .space-tools button:hover,
#guide .space-tools button[aria-pressed="true"] {
  background: #1a4264;
  color: #fff;
}
#guide #my-poster {
  background: #173c59;
  color: #e5f6ff;
}
#guide #space-checkin {
  background: #087fe8;
  color: #fff;
  border: 1px solid #80cbff66;
  border-radius: 12px;
  min-height: 48px;
}
#guide #back-form,
body[data-browse-only="true"] #guide #back-form {
  min-height: 46px;
  border: 1px solid #66b5ed4d;
  border-radius: 12px;
  background: #0b2740;
  color: #d8efff;
  font-size: 13px;
  font-weight: 500;
}
#guide #back-form:hover {
  background: #174669;
}
@media (max-width: 480px) {
  #guide {
    padding: 14px;
    gap: 10px;
    width: calc(100% - 28px);
  }
}

.destination-stage {
  --stage-height: clamp(400px, 52dvh, 570px);
  height: var(--stage-height);
}
.destination-card {
  padding: 32px 12px 48px;
  gap: 7px;
}
.destination-world {
  filter: drop-shadow(0 16px 20px #000);
  width: min(80%, -170px + var(--stage-height) * 0.92);
  flex: none;
  aspect-ratio: 1;
}
.destination-card strong,
.destination-en {
  flex: none;
  line-height: 1.2;
  white-space: nowrap;
}
.destination-no {
  flex: none;
  margin-top: 0;
}
@media (max-width: 600px) {
  .destination-stage {
    --stage-height: clamp(360px, 48dvh, 460px);
  }
  .destination-card {
    padding-top: 28px;
    padding-bottom: 40px;
  }
  .destination-world {
    width: min(80%, -145px + var(--stage-height) * 0.92);
  }
}
@media (max-height: 700px) {
  .destination-stage {
    --stage-height: 350px;
  }
}
body[data-browse-only="false"]
  #guide
  .space-tools:has(#space-find-free[hidden]) {
  display: none;
}
body[data-browse-only="false"] #guide #back-form {
  border: 0;
  background: transparent;
  min-height: 32px;
  padding: 4px;
  color: #bdd6e8;
}
body[data-browse-only="false"] #guide .space-tools {
  grid-template-columns: 1fr;
}

#next-planet:disabled,
#previous-planet:disabled {
  cursor: default;
}

body[data-view="form"]:has(.panel.poster) {
  background: radial-gradient(
    ellipse at 50% 15%,
    #184269,
    #0a2540 45%,
    #030916 90%
  );
}
body[data-view="form"] .panel.poster {
  width: min(420px, 100% - 24px);
  max-width: 420px;
  padding: 0;
  margin: calc(56px + env(safe-area-inset-top)) auto
    calc(12px + env(safe-area-inset-bottom));
}
.panel.poster .poster-image {
  display: block;
  border: 1px solid #92c4e9;
  box-sizing: border-box;
  box-shadow: 0 18px 60px #020e2355;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: max(240px, 100vh - 200px);
  max-height: max(
    240px,
    100svh - 200px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
}
.panel.poster .poster-actions > * {
  grid-column: auto;
  min-height: 44px;
  min-width: 0;
  padding: 8px 6px;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    Hiragino Sans,
    Yu Gothic,
    sans-serif;
  font-size: clamp(14px, 3.7vw, 15px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: normal;
}
.panel.poster .hint {
  color: #e3f1ff;
}
.panel.poster .poster-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.panel.poster .poster-actions #download,
.panel.poster .poster-actions #experience-3d {
  grid-column: auto;
  min-height: 46px;
  font-size: clamp(14px, 4vw, 16px);
  font-weight: 600;
}
#experience-3d {
  border: 1px solid #67b9ff;
  color: #e4f6ff;
  background: #123357;
}
.panel.poster .poster-actions #experience-3d[aria-disabled="true"] {
  background: #132030;
  color: #b0bdcc;
  border-color: #455468;
  cursor: default;
}
.panel.poster .poster-actions #next-person {
  grid-column: auto;
  background: transparent;
  border-color: #455468;
  color: #c8d9e9;
  font-weight: 500;
}
.panel.poster .hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}

#form .visit-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 16px 0 0;
}
#form .visit-days label {
  flex: 1 0 135px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  background: #0b192a;
  border: 1px solid #687f97;
  border-radius: 8px;
  color: var(--space-text);
  cursor: pointer;
}
#form .visit-days label:has(:checked) {
  background: #10416b;
  border-color: var(--space-accent-border);
}
#form .visit-days input {
  appearance: auto;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: var(--space-accent);
}

.message-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.message-presets button {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: left;
  line-height: 1.4;
}
.message-presets button[aria-pressed="true"] {
  background: #10416b;
  border-color: var(--space-accent-border);
}

.top-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-heading img,
.top-brand img {
  display: block;
  height: auto;
}
.top-brand img {
  width: clamp(116px, 25vw, 164px);
}
.brand-heading img {
  width: min(100%, 295px);
}
.avatars label {
  background: linear-gradient(150deg, #12243a, #080f1d);
  border-color: #70caff38;
}
.avatars label:hover {
  border-color: var(--space-accent-border);
}
.avatars label:has(input:checked) {
  border-color: var(--space-accent-border);
}
.avatars label:has(input:checked):after {
  content: "✓";
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--space-accent);
  color: #fff;
  font-size: 12px;
}

.panel.poster .poster-live #download {
  grid-column: 1/-1;
}
.panel.poster .poster-live #all {
  grid-column: 1;
  grid-row: 2;
}
.panel.poster .poster-live #experience-3d {
  grid-column: 2;
  grid-row: 2;
}

.panel.poster .poster-preview {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.panel.poster .hint:empty {
  display: none;
}
.scan-dialog {
  box-sizing: border-box;
  width: min(96vw, 80svh, 640px);
  max-width: 100%;
  padding: 8px;
}
.scan-dialog::backdrop {
  background: rgba(2, 9, 20, 0.94);
}
.scan-dialog canvas {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  border-radius: 0;
  image-rendering: pixelated;
}
.scan-dialog form {
  margin: 8px 0 0;
}
.scan-dialog button {
  width: 100%;
}


.panel.poster .show-qr {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  color: #d9f2ff;
  font-size: 15px;
  border-color: #70caff80;
  touch-action: manipulation;
}
.scan-dialog canvas {
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
