* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #03040a; color: #e9ecf5; overflow: hidden;
  font: 15px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#sky { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; cursor: grab; }
#sky:active { cursor: grabbing; }
#nogl { position: fixed; top: 40%; left: 0; right: 0; text-align: center; padding: 0 24px; color: #9aa3b8; }
a { color: #9fc4ff; }
button { font: inherit; color: inherit; cursor: pointer; }

.top { position: fixed; top: 0; left: 0; right: 0; padding: 18px 22px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px 22px; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; flex-direction: column; }
.brand b { font-size: 20px; letter-spacing: 0.02em; }
.brand span { color: #8d97ad; font-size: 13px; }
.namebar { display: flex; gap: 6px; flex: 1 1 280px; max-width: 460px; }
.namebar input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; border: 1px solid #ffffff2a;
  background: #0b0e1acc; color: #fff; font-size: 17px; outline: none; backdrop-filter: blur(8px); }
.namebar input:focus { border-color: #9fc4ff; }
.namebar button { width: 48px; border-radius: 999px; border: 1px solid #ffffff2a; background: #0b0e1acc; font-size: 20px; }
.chips { color: #8d97ad; font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chips button { background: #ffffff10; border: 1px solid #ffffff1c; border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.chips button:hover, .namebar button:hover, .actions button:hover { background: #ffffff22; }

.card { position: fixed; left: 22px; bottom: 44px; width: min(380px, calc(100vw - 44px)); padding: 18px 20px;
  border-radius: 18px; background: #070912b8; border: 1px solid #ffffff18; backdrop-filter: blur(10px); }
.kind { margin: 0; color: #9aa3b8; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
h1 { margin: 2px 0 6px; font-size: 34px; line-height: 1.1; word-break: break-word; }
.note { margin: 0 0 12px; font-style: italic; color: #cdd3e1; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; margin: 0 0 14px; }
.facts div { min-width: 0; }
.facts dt { color: #7f899f; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.facts dd small { font-size: 10px; color: #7f899f; margin-left: 4px; }
summary { cursor: pointer; color: #9aa3b8; font-size: 12px; margin-bottom: 10px; }
.card { max-height: var(--card-height, 70vh); overflow: auto; bottom: var(--card-bottom, 44px); }
.actions { display: flex; gap: 8px; }
.actions button { flex: 1; padding: 10px 8px; border-radius: 12px; border: 1px solid #ffffff22; background: #ffffff12; }
.land { width: 100%; margin: 0 0 8px; padding: 11px 8px; border-radius: 12px; border: 1px solid #9fc4ff55;
  background: linear-gradient(90deg, #2b4a8a99, #6a3d8a99); font-weight: 600; }
.land:hover { filter: brightness(1.2); }
.addfriend { width: 100%; margin: 0 0 8px; padding: 9px 8px; border-radius: 12px; border: 1px dashed #ffffff33;
  background: transparent; color: #c9d4ee; }
.addfriend:hover { background: #ffffff12; }
.friendbar { display: flex; gap: 6px; margin: 0 0 8px; }
.friendbar[hidden] { display: none; }
.friendbar input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid #f0b4ff55;
  background: #ffffff10; color: #fff; font: inherit; outline: none; }
.friendbar input:focus { border-color: #f0b4ff; }
.friendbar button { width: 42px; border-radius: 12px; border: 1px solid #ffffff22; background: #ffffff12; }
.landed #survey, .landed .chips { display: none; }
.landed .card { backdrop-filter: blur(6px); background: #070912a0; }
.status { margin: 8px 0 0; min-height: 1.2em; font-size: 13px; color: #9fc4ff; }
.status:empty { display: none; }
.foot { position: fixed; right: 22px; bottom: 14px; left: 22px; text-align: right; color: #6f7890; font-size: 12px; pointer-events: none; }
/* Landed, the footer sits over bright ground and sky. */
.landed .foot { color: #c9d0de; text-shadow: 0 1px 3px #000, 0 0 8px #000c; }
.landed .foot a { color: #cfe0ff; }
.foot a { pointer-events: auto; color: #8fa6cf; }

@media (max-width: 720px), (orientation: portrait) {
  .top { padding: 12px 14px; gap: 8px; }
  .brand { flex-direction: row; align-items: baseline; gap: 8px; }
  .namebar { flex-basis: 100%; max-width: none; }
  /* One swipeable row of suggestions, so a first visit on a phone isn't just an empty box. */
  .chips { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; font-size: 12px; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { flex: none; font-size: 12px; padding: 4px 10px; }
  .paired .chips { display: none; }
  .card { left: 10px; right: 10px; width: auto; padding: 14px 16px; }
  h1 { font-size: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .note { font-size: 14px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .facts { gap: 4px 10px; margin-bottom: 10px; }
  .foot { text-align: center; bottom: 8px; font-size: 11px; }
  .foot .long { display: none; }
}

@media (max-height: 600px) {
  .chips { display: none; }
}
@media (max-height: 500px) {
  .card { padding: 12px 16px; }
  h1 { font-size: 26px; }
  .note { font-size: 13px; margin-bottom: 8px; }
  summary { margin-bottom: 8px; }
  .actions button { padding: 8px; font-size: 13px; }
}
@media (max-width: 360px) {
  .facts dd { font-size: 13px; }
}

.frameboth { width: 100%; padding: 8px; margin-bottom: 8px; border: 1px solid #f0b4ff55;
  border-radius: 12px; background: #633d7a55; }
.frameboth[hidden] { display: none; }
.portrait { padding: 12px; border: 1px solid #ffffff33; border-radius: 18px; color: #e9ecf5;
  background: #0b0e1a; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
.portrait::backdrop { background: #03040ae8; }
.portrait img { display: block; width: min(60dvh, calc(100vw - 52px), 600px); height: auto; max-width: 100%; margin: 0 auto 12px; }

@media (max-width: 720px), (orientation: portrait) {
  .journey { display: flex; gap: 8px; }
  .journey button { flex: 1; font-size: 13px; }
  .journey button[hidden] { display: none; }
}

.surveyhint { display: none; }
@media (max-width: 720px), (orientation: portrait) {
  details:not([open]) .surveyhint { display: inline; }
}

@media (max-width: 720px), (orientation: portrait) {
  .paired .note { display: -webkit-box; font-size: 12px; line-height: 1.3; -webkit-line-clamp: 2; }
  .paired .card { padding-top: 10px; padding-bottom: 10px; }
  .paired .journey button, .paired .actions button { padding-top: 8px; padding-bottom: 8px; }
}

.skylabels { position: fixed; inset: 0; pointer-events: none; }
.skylabels span { position: absolute; transform: translate(-50%, -50%); max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 10px;
  border: 1px solid #ffffff55; border-radius: 999px; background: #03040aa8;
  color: #fff; font-size: 12px; text-shadow: 0 1px 3px #000; }
@media (max-width: 360px) {
  .actions button { font-size: 13px; }
  .paired .card { padding: 10px 12px; }
  .paired h1 { font-size: 24px; margin-bottom: 4px; }
  .paired summary { margin-bottom: 6px; }
  .paired .friendbar, .paired .frameboth, .paired .journey button { margin-bottom: 6px; }
  .paired .friendbar input { padding: 7px 10px; }
  .paired .frameboth { padding: 6px; }
  .paired .actions button, .paired .journey button { padding: 7px 4px; }
}
