:root {
  --ink: #dfe7ff;
  --dim: rgba(223, 231, 255, 0.55);
  --faint: rgba(223, 231, 255, 0.32);
  --gold: #f2c76e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05060d;
  color: var(--ink);
  font-family: var(--mono);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.hud {
  position: fixed;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.top-left {
  top: calc(env(safe-area-inset-top) + 20px);
  left: calc(env(safe-area-inset-left) + 22px);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 4.6vw, 2.4rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(127, 214, 255, 0.35);
}

.sub {
  margin: 0.55rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

#count { color: var(--gold); }

.top-right {
  top: calc(env(safe-area-inset-top) + 18px);
  right: calc(env(safe-area-inset-right) + 18px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

button {
  pointer-events: auto;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  background: rgba(5, 6, 13, 0.45);
  border: 1px solid rgba(223, 231, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: color 0.2s, border-color 0.2s;
}

button:hover, button:focus-visible {
  color: var(--ink);
  border-color: rgba(223, 231, 255, 0.6);
  outline: none;
}

#restore { color: var(--gold); border-color: rgba(242, 199, 110, 0.5); }

.bottom {
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 64px);
  margin: 0 auto;
  padding: 0 22px;
  max-width: 38rem;
  text-align: center;
}

#status {
  margin: 0;
  min-height: 3.1em;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 2.9vw, 1.2rem);
  line-height: 1.5;
  text-shadow: 0 1px 14px #05060d, 0 0 4px #05060d;
}

#status::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 1em;
  margin-left: 0.15em;
  vertical-align: -0.15em;
  background: var(--gold);
  opacity: 0.7;
  animation: blink 1.1s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

#hint {
  margin: 0.8rem 0 0;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.foot {
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  padding: 0 16px;
  text-align: center;
  font-size: 0.58rem;
  line-height: 1.7;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.foot a {
  pointer-events: auto;
  color: var(--dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.foot a:hover, .foot a:focus-visible { color: var(--gold); outline: none; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 2rem;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
}

/* Short screens (phones in landscape): keep the text out of the constellation. */
@media (max-height: 460px) {
  #hint, .foot { display: none; }
  .bottom { bottom: calc(env(safe-area-inset-bottom) + 10px); }
  #status { min-height: 0; font-size: 0.95rem; }
  .sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #status::after { animation: none; }
}

/* 404 */
.lost {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 1.2rem;
  padding: 2rem;
  text-align: center;
}
.lost p { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.15rem; }
.lost a { color: var(--gold); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; }
