/* Noctalia is intentionally small: plain CSS, no framework, no build step. */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #050609;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: #f6f0df;
  background: #050609;
}

/*
  The full-page painting belongs to the viewport, not the document height.
  Expanding First Light therefore reveals text without moving the sea behind it.
*/
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 18%, rgba(87, 121, 160, 0.2), transparent 29rem),
    linear-gradient(
      180deg,
      rgba(8, 12, 20, 0.2),
      rgba(8, 12, 20, 0.34) 46%,
      rgba(5, 7, 12, 0.66)
    ),
    url("assets/noctalia-night-sea-watercolor-v4-dome-palette.png"),
    linear-gradient(160deg, #101725, #090d14 55%, #050609);
  background-position:
    center top,
    center,
    center bottom,
    center;
  background-repeat: no-repeat;
  background-size:
    auto,
    cover,
    cover,
    auto;
}

.app {
  width: min(920px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.sky-panel {
  text-align: center;
}

.sky-viewport {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto;
}

h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 400;
  letter-spacing: 0;
}

.subtitle {
  margin: 8px 0 24px;
  color: #cfc6ad;
}

#skyCanvas {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  margin: 0 auto;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

#skyCanvas.is-dragging {
  cursor: grabbing;
}

.sky-focus-button,
.sky-focus-close {
  display: none;
}

.sky-paint-button {
  position: absolute;
  left: 8%;
  bottom: 8%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  color: rgba(238, 216, 163, 0.86);
  background: rgba(7, 12, 21, 0.48);
  border: 1px solid rgba(230, 201, 135, 0.28);
  border-radius: 50%;
  box-shadow:
    inset 0 0 10px rgba(230, 201, 135, 0.04),
    0 0 16px rgba(230, 201, 135, 0.08);
  backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  transition:
    color 250ms ease,
    background-color 250ms ease,
    border-color 250ms ease,
    box-shadow 250ms ease;
}

.sky-paint-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 2px rgba(255, 241, 199, 0.72))
    drop-shadow(0 0 5px rgba(230, 201, 135, 0.32));
  transition:
    opacity 250ms ease,
    filter 250ms ease;
}

.sky-paint-button .milky-way-band {
  fill: none;
  stroke: currentColor;
}

.sky-paint-button .milky-way-band-soft {
  stroke-width: 4.5;
  opacity: 0.2;
}

.sky-paint-button .milky-way-band-core {
  stroke-width: 1.25;
  opacity: 0.8;
}

.sky-paint-button .milky-way-dot,
.sky-paint-button .milky-way-star {
  fill: currentColor;
  stroke: none;
  opacity: 0.88;
}

.sky-paint-button .milky-way-dot-small {
  opacity: 0.58;
}

.sky-paint-button .milky-way-star-large {
  opacity: 1;
}

.sky-paint-button .milky-way-star-distant {
  opacity: 0.74;
}

.sky-paint-button[aria-pressed="false"] {
  color: rgba(164, 184, 205, 0.68);
  background: rgba(2, 5, 9, 0.72);
  border-color: rgba(164, 184, 205, 0.2);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.3);
}

.sky-paint-button[aria-pressed="false"] svg {
  opacity: 0.42;
  filter: none;
}

/*
  Mobile browsers can retain hover/focus while a finger is held. These states
  deliberately keep the same quiet circular treatment as the resting button.
*/
.sky-paint-button:hover,
.sky-paint-button:focus-visible,
.sky-paint-button:active {
  color: rgba(238, 216, 163, 0.9);
  background: rgba(7, 12, 21, 0.56);
  border-color: rgba(230, 201, 135, 0.34);
  outline: none;
}

.sky-paint-button[aria-pressed="false"]:hover,
.sky-paint-button[aria-pressed="false"]:focus-visible,
.sky-paint-button[aria-pressed="false"]:active {
  color: rgba(164, 184, 205, 0.72);
  background: rgba(2, 5, 9, 0.76);
  border-color: rgba(164, 184, 205, 0.24);
}

.sky-focus-button {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.sky-focus-button:hover,
.sky-focus-button:focus-visible,
.sky-focus-button:active {
  color: rgba(238, 216, 163, 0.86);
  background: rgba(7, 12, 21, 0.52);
  border-color: rgba(230, 201, 135, 0.3);
  outline: none;
  box-shadow:
    inset 0 0 10px rgba(230, 201, 135, 0.04),
    0 0 16px rgba(230, 201, 135, 0.08);
}

.sky-focus-hint {
  display: none;
}

body.sky-focus-mode {
  overflow: hidden;
}

body.sky-focus-mode .sky-viewport {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(38, 57, 80, 0.34), transparent 60%),
    linear-gradient(155deg, #111b2b, #080d16 62%, #05070b);
}

body.sky-focus-mode #skyCanvas {
  width: min(94vw, 94vh);
  width: min(94vw, 94dvh);
  max-width: none;
  margin: 0;
  cursor: grab;
  touch-action: none;
  transform-origin: center;
  will-change: transform;
}

body.sky-focus-mode #skyCanvas:active {
  cursor: grabbing;
}

body.sky-focus-mode .sky-focus-button {
  display: none;
}

body.sky-focus-mode .sky-paint-button {
  position: absolute;
  bottom: max(14px, calc(env(safe-area-inset-bottom) + 6px));
  left: max(14px, env(safe-area-inset-left));
}

body.sky-focus-mode .sky-focus-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  color: rgba(242, 225, 184, 0.88);
  background: rgba(7, 12, 21, 0.54);
  border: 1px solid rgba(230, 201, 135, 0.28);
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-size: 24px;
  line-height: 1;
  backdrop-filter: blur(5px);
}

body.sky-focus-mode .sky-focus-hint {
  position: absolute;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
  left: 50%;
  z-index: 2;
  display: block;
  margin: 0;
  color: rgba(238, 216, 163, 0.76);
  font-size: 12px;
  letter-spacing: 0;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}

body.sky-focus-mode .sky-focus-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.controls {
  width: min(880px, 100%);
  margin: 22px auto 0;
  display: grid;
  grid-template-areas:
    "place date time play"
    "place date tempo tempo";
  grid-template-columns: 220px 220px minmax(254px, 1fr) 92px;
  gap: 8px 12px;
  align-items: end;
  font-family: Arial, sans-serif;
}

.release-footer {
  width: min(880px, 100%);
  margin: 24px auto 0;
  color: rgba(207, 198, 173, 0.62);
  text-align: center;
}

.release-note {
  display: inline-block;
  max-width: 660px;
  font-size: 12px;
  line-height: 1.55;
}

.release-note summary {
  width: max-content;
  margin: 0 auto;
  color: rgba(230, 201, 135, 0.66);
  cursor: pointer;
  list-style: none;
}

.release-note summary::-webkit-details-marker {
  display: none;
}

.release-note summary::before,
.release-note summary::after {
  content: "·";
  padding: 0 8px;
  color: rgba(230, 201, 135, 0.34);
}

.release-note[open] summary {
  color: rgba(238, 216, 163, 0.86);
}

.release-note-content {
  margin-top: 12px;
  padding: 14px 18px;
  background: rgba(7, 12, 20, 0.36);
  border-top: 1px solid rgba(230, 201, 135, 0.14);
}

.release-note-content p {
  margin: 0;
}

.release-note-content p + p {
  margin-top: 8px;
}

.release-note a {
  color: rgba(238, 216, 163, 0.82);
  text-decoration-color: rgba(238, 216, 163, 0.28);
  text-underline-offset: 2px;
}

.release-note a:hover,
.release-note a:focus-visible {
  color: #f0d99f;
  text-decoration-color: currentColor;
}

label {
  display: grid;
  gap: 8px;
  color: #ddd5c3;
  font-size: 14px;
}

.place-label {
  grid-area: place;
}

.location-status {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: min(86vw, 420px);
  padding: 7px 12px;
  color: rgba(244, 231, 196, 0.92);
  background: rgba(8, 18, 32, 0.9);
  border: 1px solid rgba(230, 201, 135, 0.22);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.location-status.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.location-status.is-error {
  color: rgba(226, 184, 172, 0.96);
  border-color: rgba(171, 91, 82, 0.34);
}

.date-label {
  grid-area: date;
  position: relative;
}

.time-label {
  grid-area: time;
}

.place-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px;
  gap: 8px;
}

.observer {
  display: block;
  max-width: 100%;
  min-height: 15px;
  margin-top: -2px;
  overflow: hidden;
  color: rgba(246, 240, 223, 0.68);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input,
select,
button {
  font: inherit;
}

input[type="number"] {
  min-height: 42px;
  padding: 0 12px;
  color: #f6f0df;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.date-control {
  display: grid;
  gap: 6px;
}

.calendar-whisper {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 1;
  width: max-content;
  max-width: min(290px, 90vw);
  color: rgba(238, 216, 163, 0.8);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 1px 8px rgba(4, 8, 14, 0.9);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -2px);
  transition:
    opacity 280ms ease,
    transform 280ms ease;
}

.calendar-whisper.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.date-step-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.date-step-button {
  display: grid;
  place-items: center;
  min-height: 30px;
  min-width: 24px;
  padding: 0;
  color: rgba(230, 201, 135, 0.88);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(230, 201, 135, 0.2);
  border-radius: 999px;
}

.date-step-button:hover {
  color: #f0d99f;
  background: rgba(230, 201, 135, 0.12);
  border-color: rgba(230, 201, 135, 0.34);
}

.date-step-button svg {
  width: 17px;
  height: 17px;
  filter: drop-shadow(0 0 5px rgba(230, 201, 135, 0.14));
}

.date-step-button .triangle {
  fill: currentColor;
  stroke: rgba(255, 244, 210, 0.22);
  stroke-width: 0.7;
  stroke-linejoin: round;
}

.date-step-button .triangle-two {
  opacity: 0.72;
}

.almanac-button {
  color: rgba(238, 216, 163, 0.9);
  background: rgba(7, 14, 25, 0.38);
  border-color: rgba(230, 201, 135, 0.3);
}

.almanac-button .telescope-body,
.almanac-button .telescope-rim {
  fill: rgba(221, 198, 146, 0.08);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.almanac-button .telescope-neck,
.almanac-button .telescope-stand {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.almanac-button .telescope-body {
  stroke-width: 1.05;
}

.almanac-button .telescope-rim {
  fill: rgba(238, 216, 163, 0.16);
  stroke-width: 1.2;
}

.almanac-button .telescope-neck {
  stroke-width: 1.35;
}

.almanac-button .telescope-stand {
  stroke-width: 1.05;
  opacity: 0.82;
}

.almanac-button:hover,
.almanac-button:focus-visible {
  color: #fff0bd;
  outline: none;
  box-shadow:
    inset 0 0 10px rgba(230, 201, 135, 0.09),
    0 0 16px rgba(230, 201, 135, 0.2);
}

.current-moment-button {
  color: rgba(255, 246, 214, 0.92);
  border-color: rgba(230, 201, 135, 0.28);
  box-shadow:
    inset 0 0 10px rgba(230, 201, 135, 0.05),
    0 0 12px rgba(230, 201, 135, 0.08);
}

.current-moment-button:hover {
  color: #fff9df;
  box-shadow:
    inset 0 0 12px rgba(230, 201, 135, 0.09),
    0 0 18px rgba(230, 201, 135, 0.16);
}

.current-moment-button .moment-ring,
.current-moment-button .moment-hand {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.current-moment-button .moment-ring {
  opacity: 0.78;
}

.current-moment-button .moment-spark {
  fill: currentColor;
  opacity: 0.78;
}

.date-fields {
  display: grid;
  grid-template-columns: 38px 64px 58px 46px;
  gap: 4px;
  justify-content: center;
}

.date-fields input,
.date-fields select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 7px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.date-fields select {
  padding-right: 21px;
  text-align-last: center;
  background:
    linear-gradient(45deg, transparent 50%, rgba(230, 201, 135, 0.85) 50%) right 10px center / 5px 5px no-repeat,
    linear-gradient(135deg, rgba(230, 201, 135, 0.85) 50%, transparent 50%) right 7px center / 5px 5px no-repeat,
    rgba(255, 255, 255, 0.08);
}

.date-year-input {
  min-width: 58px;
}

.date-fields .date-era-input {
  min-width: 46px;
  padding: 0 4px;
  color: rgba(238, 216, 163, 0.9);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(230, 201, 135, 0.18);
  font-family: Georgia, serif;
  font-size: 11px;
  text-align-last: center;
}

select {
  min-height: 42px;
  padding: 0 34px 0 12px;
  color: #f6f0df;
  background:
    linear-gradient(45deg, transparent 50%, rgba(230, 201, 135, 0.85) 50%) right 15px center / 7px 7px no-repeat,
    linear-gradient(135deg, rgba(230, 201, 135, 0.85) 50%, transparent 50%) right 10px center / 7px 7px no-repeat,
    rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(230, 201, 135, 0.22);
  border-radius: 6px;
  appearance: none;
}

select option {
  color: #101725;
  background: #f6f0df;
}

input[type="range"] {
  width: 100%;
  accent-color: #e6c987;
}

#timeSlider {
  --time-slider-background: rgba(246, 240, 223, 0.28);
  min-height: 18px;
  background: transparent;
  appearance: none;
}

#timeSlider::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--time-slider-background);
  border-radius: 999px;
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.08);
}

#timeSlider::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  background: #ead08a;
  border: 1px solid rgba(255, 248, 220, 0.78);
  border-radius: 50%;
  box-shadow:
    0 0 8px rgba(230, 201, 135, 0.42),
    0 0 18px rgba(230, 201, 135, 0.18);
  appearance: none;
}

#timeSlider::-moz-range-track {
  height: 4px;
  background: var(--time-slider-background);
  border-radius: 999px;
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.08);
}

#timeSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #ead08a;
  border: 1px solid rgba(255, 248, 220, 0.78);
  border-radius: 50%;
  box-shadow:
    0 0 8px rgba(230, 201, 135, 0.42),
    0 0 18px rgba(230, 201, 135, 0.18);
}

.time-readouts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: rgba(246, 240, 223, 0.62);
  font-size: 13px;
}

.time-readouts strong {
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  color: #e6c987;
}

button {
  min-height: 42px;
  padding: 0 18px;
  color: #15120b;
  background: #e6c987;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background: #f0d99f;
}

#playButton {
  justify-self: center;
  width: auto;
  min-width: 68px;
  min-height: 40px;
  padding: 0 28px;
  color: #211807;
  background: rgba(230, 201, 135, 0.92);
  box-shadow: 0 0 18px rgba(230, 201, 135, 0.12);
}

.play-control {
  grid-area: play;
  display: grid;
  justify-items: center;
  align-self: end;
}

.tempo-control {
  position: relative;
  grid-area: tempo;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  min-height: 28px;
  color: rgba(216, 205, 178, 0.58);
}

.tempo-orbit {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-right: 5px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.15;
}

.tempo-orbit-star {
  fill: currentColor;
  stroke: none;
}

.tempo-trail {
  display: flex;
  justify-content: center;
  gap: 1px;
  min-height: 28px;
}

.tempo-star {
  position: relative;
  min-width: 28px;
  width: 28px;
  min-height: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  opacity: 0.82;
}

.tempo-star::before {
  content: "";
  position: absolute;
  inset: 11.5px;
  background: rgba(239, 225, 188, 0.86);
  border-radius: 50%;
  box-shadow:
    0 0 4px rgba(245, 230, 195, 0.24),
    0 0 9px rgba(230, 201, 135, 0.16);
}

.tempo-star:hover,
.tempo-star:focus-visible {
  opacity: 1;
  outline: none;
}

.tempo-star.is-active {
  opacity: 1;
}

.tempo-star.is-active::before {
  inset: 10px;
  background: #fffbe8;
  box-shadow:
    0 0 4px rgba(255, 252, 230, 0.98),
    0 0 12px rgba(247, 224, 162, 0.9),
    0 0 24px rgba(236, 204, 126, 0.52),
    0 0 38px rgba(236, 204, 126, 0.22);
}

.tempo-star.is-active::after {
  content: "";
  position: absolute;
  inset: 5px;
  background:
    linear-gradient(to right, transparent 45%, rgba(255, 247, 215, 0.92) 49%, rgba(255, 247, 215, 0.92) 51%, transparent 55%),
    linear-gradient(to bottom, transparent 45%, rgba(255, 247, 215, 0.92) 49%, rgba(255, 247, 215, 0.92) 51%, transparent 55%),
    linear-gradient(45deg, transparent 46%, rgba(255, 238, 186, 0.46) 49%, rgba(255, 238, 186, 0.46) 51%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(255, 238, 186, 0.46) 49%, rgba(255, 238, 186, 0.46) 51%, transparent 54%);
  filter: blur(0.25px);
  opacity: 0.9;
}

.tempo-star[data-speed-level="1"]::before {
  background: transparent;
  border: 1px solid rgba(239, 225, 188, 0.82);
}

.tempo-star[data-speed-level="1"].is-active::before {
  background:
    radial-gradient(circle, #fffbe8 0 32%, transparent 36%);
  border-color: #fffbe8;
}

.tempo-readout {
  position: absolute;
  top: 50%;
  left: 0;
  max-width: 92px;
  color: rgba(238, 216, 163, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(calc(-50% + 3px));
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.tempo-readout.is-visible {
  opacity: 1;
  transform: translateY(-50%);
}

.world-button {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0;
  color: #e6c987;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(230, 201, 135, 0.28);
}

.world-button:hover {
  background: rgba(230, 201, 135, 0.14);
}

.world-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.location-button.is-locating svg {
  animation: location-seeking 1.2s ease-in-out infinite;
}

.location-button.is-error {
  color: rgba(167, 186, 199, 0.72);
  border-color: rgba(167, 186, 199, 0.28);
  opacity: 0.72;
}

@keyframes location-seeking {
  50% {
    opacity: 0.4;
    transform: scale(0.88);
  }
}

.world-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1050px) {
  .controls {
    width: min(760px, 100%);
    grid-template-areas:
      "place date play"
      "time time time"
      "tempo tempo tempo";
    grid-template-columns: 238px 220px minmax(106px, 1fr);
    row-gap: 8px;
  }

  .play-control {
    align-self: end;
  }

  .time-label {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .app {
    width: calc(100vw - 12px);
    padding: 14px 0 24px;
  }

  h1 {
    font-size: 34px;
  }

  .subtitle {
    margin: 4px 0 12px;
    font-size: 14px;
  }

  .sky-focus-button {
    position: absolute;
    right: 8%;
    bottom: 8%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    color: rgba(238, 216, 163, 0.86);
    background: rgba(7, 12, 21, 0.48);
    border: 1px solid rgba(230, 201, 135, 0.28);
    border-radius: 50%;
    box-shadow:
      inset 0 0 10px rgba(230, 201, 135, 0.04),
      0 0 16px rgba(230, 201, 135, 0.08);
    backdrop-filter: blur(4px);
  }

  .sky-paint-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .sky-focus-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .sky-focus-button .focus-star {
    fill: currentColor;
    stroke: none;
    opacity: 0.86;
  }

  .controls {
    width: min(390px, 100%);
    grid-template-areas:
      "time play"
      "tempo tempo"
      "place place"
      "date date";
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 10px 8px;
    margin-top: 10px;
    align-items: end;
    justify-items: stretch;
  }

  .controls label,
  .play-control {
    width: 100%;
    max-width: none;
  }

  .controls .place-label,
  .controls .date-label {
    gap: 4px;
    font-size: 12px;
  }

  .observer {
    display: none;
  }

  .place-control {
    grid-template-columns: minmax(0, 1fr) 42px 42px;
    gap: 6px;
  }

  .place-control select,
  .world-button {
    min-height: 42px;
  }

  .time-label {
    gap: 3px;
    font-size: 0;
  }

  .time-readouts {
    justify-content: flex-start;
    gap: 12px;
    font-size: 11px;
  }

  #timeSlider {
    width: 100%;
    justify-self: stretch;
  }

  #playButton {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 12px;
  }

  .tempo-control {
    justify-content: flex-end;
    min-height: 32px;
  }

  .tempo-star {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .tempo-star::before {
    inset: 17.5px;
  }

  .tempo-star.is-active::before {
    inset: 16px;
  }

  .tempo-star.is-active::after {
    inset: 10px;
  }

  .tempo-readout {
    top: 50%;
    left: 0;
    max-width: 72px;
    font-size: 10px;
    transform: translateY(calc(-50% + 3px));
  }

  .tempo-readout.is-visible {
    transform: translateY(-50%);
  }

  .date-control {
    gap: 4px;
  }

  .date-step-row {
    gap: 4px;
  }

  .date-step-button {
    min-width: 40px;
    min-height: 40px;
  }

  /*
    iOS zooms the page when an editable control uses text below 16px.
    This prevents that jump without adding JavaScript.
  */
  input,
  select {
    font-size: 16px;
  }

  .date-fields input,
  .date-fields select,
  .date-fields .date-era-input {
    font-size: 16px;
  }

  .release-footer {
    margin-top: 18px;
  }
}

/*
  Celestial almanac
  -----------------
  The painted line is a canvas, while each small event has a larger invisible
  HTML button around it. This keeps the artwork delicate and iPhone taps easy.
*/
.almanac-modal {
  position: fixed;
  inset: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 13, 0.38);
  backdrop-filter: blur(3px);
}

.almanac-modal[aria-hidden="true"] {
  display: none;
}

.almanac-dialog {
  width: min(920px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  padding: 18px 20px 16px;
  color: #f6f0df;
  background:
    radial-gradient(circle at 18% 0%, rgba(115, 145, 154, 0.14), transparent 23rem),
    linear-gradient(155deg, rgba(20, 34, 51, 0.97), rgba(7, 13, 23, 0.98));
  border: 1px solid rgba(230, 201, 135, 0.25);
  border-radius: 8px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.almanac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
}

.almanac-header h2 {
  margin: 0;
  color: rgba(238, 216, 163, 0.92);
  font-size: 23px;
  font-weight: 400;
}

.almanac-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(230, 201, 135, 0.26) transparent;
  scrollbar-width: thin;
}

.almanac-timeline {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1200 / 440;
}

#almanacCanvas,
.almanac-event-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#almanacCanvas {
  display: block;
}

.almanac-event-layer {
  pointer-events: none;
}

.almanac-origin {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  color: rgba(205, 190, 155, 0.54);
  background: transparent;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.almanac-origin svg {
  width: 18px;
  height: 26px;
  overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(2, 7, 14, 0.72));
  transition:
    color 180ms ease,
    filter 180ms ease,
    transform 180ms ease;
}

.almanac-origin-pin,
.almanac-origin-orbit {
  fill: rgba(6, 14, 24, 0.5);
  stroke: currentColor;
  stroke-width: 1.05;
}

.almanac-origin-star {
  fill: currentColor;
}

.almanac-origin:hover,
.almanac-origin:focus-visible,
.almanac-origin.is-current {
  color: rgba(241, 219, 166, 0.78);
  background: transparent;
  outline: none;
}

.almanac-origin:hover svg,
.almanac-origin:focus-visible svg,
.almanac-origin.is-current svg {
  filter:
    drop-shadow(0 1px 3px rgba(2, 7, 14, 0.8))
    drop-shadow(0 0 4px rgba(255, 239, 188, 0.42));
  transform: translateY(-1px);
}

.almanac-event {
  position: absolute;
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  color: rgba(239, 217, 165, 0.78);
  background: transparent;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.almanac-event:hover,
.almanac-event:focus-visible {
  z-index: 4;
  color: #fff0bb;
  background: transparent;
  outline: none;
}

.almanac-event.is-selected {
  z-index: 3;
}

.almanac-event-glyph {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
  filter: drop-shadow(0 0 4px rgba(230, 201, 135, 0.24));
  transition:
    filter 180ms ease,
    transform 180ms ease;
}

.almanac-event:hover .almanac-event-glyph,
.almanac-event:focus-visible .almanac-event-glyph,
.almanac-event.is-selected .almanac-event-glyph {
  filter:
    drop-shadow(0 0 4px rgba(255, 240, 190, 0.9))
    drop-shadow(0 0 10px rgba(230, 201, 135, 0.48));
  transform: scale(1.16);
}

.almanac-event.is-solar-eclipse .almanac-event-glyph {
  border: 1.4px solid currentColor;
  border-radius: 50%;
}

.almanac-event.is-solar-eclipse .almanac-event-glyph::after {
  content: "";
  position: absolute;
  inset: 1px 3px 1px -1px;
  background: #07101d;
  border: 1px solid rgba(238, 216, 163, 0.45);
  border-radius: 50%;
}

.almanac-event.is-lunar-eclipse .almanac-event-glyph {
  background:
    radial-gradient(circle at 62% 38%, rgba(235, 192, 150, 0.72), transparent 48%),
    rgba(137, 73, 62, 0.78);
  border: 1px solid rgba(224, 177, 128, 0.82);
  border-radius: 50%;
}

.almanac-event.is-planet-pair .almanac-event-glyph::before,
.almanac-event.is-planet-pair .almanac-event-glyph::after,
.almanac-event.is-moon-planet .almanac-event-glyph::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
}

.almanac-event.is-planet-pair .almanac-event-glyph::before {
  left: 0;
}

.almanac-event.is-planet-pair .almanac-event-glyph::after,
.almanac-event.is-moon-planet .almanac-event-glyph::after {
  right: 0;
}

.almanac-event.is-planet-pair .almanac-event-glyph {
  background: linear-gradient(
    90deg,
    transparent 20%,
    currentColor 21%,
    currentColor 79%,
    transparent 80%
  ) center / 100% 1px no-repeat;
}

.almanac-event.is-moon-planet .almanac-event-glyph::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 0;
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  transform: rotate(-35deg);
}

.almanac-event.is-gathering .almanac-event-glyph {
  background:
    radial-gradient(circle at 50% 8%, currentColor 0 2px, transparent 2.4px),
    radial-gradient(circle at 18% 78%, currentColor 0 2px, transparent 2.4px),
    radial-gradient(circle at 82% 78%, currentColor 0 2px, transparent 2.4px);
}

.almanac-loading {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding-top: 5px;
}

.almanac-loading[hidden] {
  display: none;
}

.almanac-loading span {
  width: 4px;
  height: 4px;
  background: rgba(238, 216, 163, 0.75);
  border-radius: 50%;
  box-shadow: 0 0 9px rgba(230, 201, 135, 0.42);
  animation: almanac-pulse 1.15s ease-in-out infinite;
}

.almanac-loading span:nth-child(2) {
  animation-delay: 160ms;
}

.almanac-loading span:nth-child(3) {
  animation-delay: 320ms;
}

.almanac-loading::after {
  content: "Reading the sky\2026";
  position: absolute;
  top: 18px;
  left: 50%;
  width: max-content;
  color: rgba(216, 205, 178, 0.6);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-style: italic;
  transform: translateX(-50%);
  animation: almanac-whisper 1.8s ease-in-out infinite;
}

@keyframes almanac-pulse {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

@keyframes almanac-whisper {
  0%,
  100% {
    opacity: 0.48;
  }

  50% {
    opacity: 0.86;
  }
}

.almanac-detail {
  min-height: 82px;
  padding: 6px 16px 0;
  text-align: center;
}

.almanac-detail h3 {
  margin: 3px 0 5px;
  color: rgba(238, 216, 163, 0.94);
  font-size: 17px;
  font-weight: 400;
}

.almanac-detail p {
  margin: 0;
  color: rgba(246, 240, 223, 0.64);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.45;
}

.almanac-detail .almanac-event-time {
  color: rgba(174, 193, 197, 0.72);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.almanac-event-rating {
  display: flex;
  justify-content: center;
  gap: 2px;
  min-height: 15px;
  margin-top: 5px !important;
}

.rating-star {
  position: relative;
  display: inline-block;
  width: 12px;
  height: 12px;
  color: rgba(230, 201, 135, 0.38);
  font-size: 12px;
  line-height: 1;
}

.rating-star::before {
  content: "\2605";
}

.rating-star-fill {
  position: absolute;
  inset: 0;
  width: var(--star-fill, 0%);
  overflow: hidden;
  color: rgba(238, 216, 163, 0.82);
  text-shadow: 0 0 6px rgba(230, 201, 135, 0.28);
}

.rating-star-fill::before {
  content: "\2605";
}

@media (max-width: 640px) {
  .almanac-modal {
    align-items: start;
    padding: 12px 10px;
  }

  .almanac-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 12px 10px 14px;
  }

  .almanac-header h2 {
    font-size: 20px;
  }

  .almanac-scroll {
    margin-top: 2px;
  }

  .almanac-timeline {
    min-width: 720px;
  }

  .almanac-origin {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .almanac-origin svg {
    width: 18px;
    height: 26px;
  }

  .almanac-detail {
    min-height: 98px;
    padding-inline: 8px;
  }
}

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.map-modal[aria-hidden="true"] {
  display: none;
}

.map-dialog {
  position: absolute;
  top: clamp(72px, 8vh, 108px);
  right: clamp(12px, 3vw, 32px);
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  pointer-events: auto;
  padding: 16px;
  color: #f6f0df;
  background:
    radial-gradient(circle at 28% 8%, rgba(230, 201, 135, 0.08), transparent 16rem),
    linear-gradient(145deg, rgba(25, 39, 58, 0.88), rgba(9, 15, 25, 0.94));
  border: 1px solid rgba(230, 201, 135, 0.24);
  border-radius: 8px;
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.map-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.map-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
}

.map-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.map-header p,
.map-readout {
  margin: 6px 0 0;
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: rgba(246, 240, 223, 0.64);
}

.map-close {
  margin-left: auto;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  color: #f6f0df;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(230, 201, 135, 0.18);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.map-close:hover {
  background: rgba(230, 201, 135, 0.13);
}

.world-map-stage {
  position: relative;
}

#worldMapCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 6px;
  background: #0b1421;
  cursor: crosshair;
  box-shadow:
    0 0 0 1px rgba(230, 201, 135, 0.2),
    0 18px 45px rgba(0, 0, 0, 0.34);
}

.world-map-hint {
  margin: 0;
  padding: 0;
  color: rgba(231, 218, 185, 0.62);
  background: none;
  border: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 640px) {
  .release-footer {
    margin-top: 20px;
  }

  .release-note-content {
    padding-inline: 10px;
  }

  .map-modal {
    z-index: 9;
  }

  .map-dialog {
    top: max(8px, env(safe-area-inset-top));
    right: 6px;
    left: 6px;
    width: auto;
    max-height: calc(100dvh - 16px);
    padding: 12px;
  }

  .map-header {
    align-items: center;
    gap: 10px;
  }

  .map-heading {
    flex: 1 1 220px;
    flex-wrap: wrap;
    gap: 2px 8px;
  }

  .map-header h2 {
    font-size: 20px;
  }

  .map-readout {
    font-size: 12px;
  }

  .world-map-stage {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-color: rgba(230, 201, 135, 0.24) transparent;
    scrollbar-width: thin;
  }

  #worldMapCanvas {
    width: 700px;
    max-width: none;
  }

  .world-map-hint {
    font-size: 11px;
    white-space: normal;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .app {
    display: grid;
    grid-template-areas:
      "sky controls"
      "footer controls";
    grid-template-columns: minmax(300px, 44vw) minmax(0, 1fr);
    gap: 4px 18px;
    align-items: center;
    width: calc(100vw - 20px);
    padding-top: 8px;
  }

  .sky-panel {
    grid-area: sky;
  }

  .sky-viewport {
    width: min(72dvh, 100%);
  }

  h1 {
    font-size: 27px;
  }

  .subtitle {
    margin: 1px 0 5px;
    font-size: 12px;
  }

  .controls {
    grid-area: controls;
    grid-template-areas:
      "place place"
      "date date"
      "time play"
      "tempo tempo";
    grid-template-columns: minmax(0, 1fr) 82px;
    width: 100%;
    margin: 0;
    gap: 7px 8px;
  }

  .release-footer {
    grid-area: footer;
    margin-top: 0;
  }

  .release-note {
    font-size: 10px;
  }

  .observer {
    display: none;
  }

  .place-control {
    grid-template-columns: minmax(0, 1fr) 38px 38px;
    gap: 6px;
  }

  .place-control select,
  .world-button {
    min-height: 36px;
  }

  .date-control {
    grid-template-columns: minmax(210px, 1fr) auto;
    align-items: center;
    gap: 6px;
  }

  .date-step-row {
    gap: 3px;
  }

  .date-step-button {
    min-width: 31px;
    min-height: 31px;
  }

  .time-label {
    gap: 3px;
    font-size: 0;
  }

  .time-readouts {
    gap: 10px;
    font-size: 11px;
  }

  #playButton {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 10px;
  }

  .tempo-control {
    justify-content: flex-end;
  }

  .tempo-star {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .tempo-star::before {
    inset: 15.5px;
  }

  .tempo-star.is-active::before {
    inset: 14px;
  }

  .tempo-star.is-active::after {
    inset: 8px;
  }

  .sky-focus-button {
    position: absolute;
    right: 8%;
    bottom: 8%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    color: rgba(238, 216, 163, 0.86);
    background: rgba(7, 12, 21, 0.48);
    border: 1px solid rgba(230, 201, 135, 0.28);
    border-radius: 50%;
  }

  .sky-focus-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.2;
  }

  .map-dialog,
  .almanac-dialog {
    max-height: calc(100dvh - 12px);
  }
}
