body {
  background: radial-gradient(ellipse at 76% 5%, #423d59, transparent 60%), #172636;
}
.dome-hero {
  display: flex;
  align-items: center;
  min-height: clamp(355px, 36vw, 480px);
  margin: 20px 0 14px;
  background:
    linear-gradient(90deg, #202c40 30%, #202c40e8 38%, transparent 57%),
    url(assets/trace-observatory.webp) right 50% / 68% auto no-repeat,
    #202c40;
  border: 2px solid #998764;
  border-radius: 16px;
  overflow: hidden;
}
.dome-hero > div {
  width: 42%;
  padding: clamp(17px, 3.1vw, 46px);
}
.dome-hero h1 {
  font: 700 clamp(48px, 5vw, 82px)/0.95 var(--pixel);
  color: #ffedbd;
  margin: 9px 0;
}
.dome-hero p {
  margin: 16px 0 22px;
}
.dome-doors,
.night-grid {
  display: grid;
  gap: 14px;
}
.dome-doors {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dome-doors a,
.night-notes {
  background: #25394a;
  border: 1px solid #70818a;
  border-radius: 12px;
  padding: clamp(13px, 2vw, 22px);
}
.dome-doors a {
  color: #fff6d7;
  text-decoration: none;
  border-top: 4px solid #e3b878;
}
.dome-doors h2,
.paper-note h2,
.night-notes h2 {
  font: 700 clamp(23px, 2.1vw, 33px)/1.09 var(--pixel);
  margin: 6px 0;
}
.dome-doors p,
.paper-note p {
  margin: 7px 0;
}
.night-grid {
  grid-template-columns: minmax(0, 1.72fr) minmax(270px, 1fr);
  align-items: start;
}
.night-desk {
  color: #303b46;
  background: #f7efd8;
  border: 3px solid #bca17e;
  border-radius: 12px;
  padding: clamp(12px, 1.7vw, 24px);
  box-shadow: 0 5px 0 #615e5c;
}
.ink-label {
  color: #72552b;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.75rem;
  font-weight: 950;
}
.night-desk button {
  background: #fff9e9;
  color: #354252;
  border: 1px solid #8e8b80;
  margin: 2px;
  padding: 7px 10px;
}
.night-desk button[aria-pressed='true'] {
  background: #385b68;
  color: #fff5ce;
  border-color: #2a4854;
}
.night-desk button.gold {
  background: #ffd78b;
  color: #392f25;
  border: 2px solid #a47a47;
  margin: 8px 0 2px;
}
.night-desk a {
  color: #245b66;
}
.night-desk fieldset {
  border: 1px solid #b6aa8b;
  border-radius: 8px;
  padding: 5px 9px 8px;
  margin: 10px 0;
}
.night-desk legend,
.night-grid summary {
  font-weight: 900;
}
.night-grid summary {
  cursor: pointer;
}
.night-notes details,
.manifest {
  margin: 12px 0;
}
.night-notes li {
  margin: 7px 0;
}
.night-notes h2 {
  display: flex;
  align-items: center;
  gap: 6px;
}
.night-notes h2::before {
  content: '';
  width: 42px;
  height: 42px;
  background: url(assets/koko-idle.webp) 0 0 / 400% 100%;
  image-rendering: pixelated;
}
.keeper {
  border-top: 1px dashed #ad9f85;
  padding-top: 10px;
  margin: 12px 0 0;
}
.glass-sky,
.sky-clock {
  margin: 13px 0;
  color: #ffedbe;
  border: 3px solid #ad9669;
  border-radius: 13px;
  background-color: #21354b;
}
.glass-sky {
  position: relative;
  height: clamp(224px, 21vw, 295px);
  background-image:
    radial-gradient(circle at 32% 61%, #ffeca5 1px, transparent 2px),
    radial-gradient(circle at 12% 23%, #fff1c1 1px, transparent 2px),
    radial-gradient(circle at 65% 66%, #b3d4dc 1px, transparent 2px),
    radial-gradient(ellipse at 50% 60%, #3b4e60, transparent 70%);
  background-size:
    81px 77px,
    109px 66px,
    137px 88px,
    100% 100%;
}
.glass-sky svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.glass-sky line {
  stroke: #eed78c;
  stroke-width: 0.8;
}
.star-hub,
.glass-sky button.fire-star {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  margin: 0;
}
.star-hub {
  left: 50%;
  top: 48%;
  background: #71593a;
  border: 2px solid #efc779;
  color: #ffefc1;
  padding: 7px 14px;
  border-radius: 20px;
  font-weight: 900;
}
.glass-sky button.fire-star {
  width: min(41%, 185px);
  background: #20384b;
  color: #fff0bc;
  padding: 6px 9px;
  border: 1px solid #94aeb5;
  border-radius: 9px;
}
.glass-sky button.fire-star[aria-pressed='true'] {
  border-color: #f6d77e;
  background: #476373;
  box-shadow: 0 0 15px #e6c75e60;
}
.fire-star small,
.fire-star strong {
  display: block;
  overflow-wrap: anywhere;
}
.fire-star small {
  font-size: 0.71rem;
  color: #cbdbe1;
}
.manifest ul {
  padding-left: 20px;
}
.manifest li {
  margin: 7px 0;
  padding-bottom: 4px;
  border-bottom: 1px dashed #c2ad88;
}
.manifest code {
  font-size: 0.81rem;
  overflow-wrap: anywhere;
}
.sky-clock {
  padding: 12px;
  background-color: #203547;
}
.clock-head,
.clock-readings,
.end-links {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.clock-head {
  margin-bottom: 7px;
}
.clock-key {
  margin: 7px 0 0;
  color: #d4e4e4;
  font-size: 0.75rem;
}
.clock-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(80px, 2.6fr) 53px;
  gap: 7px;
  align-items: center;
  font-size: 0.8rem;
  line-height: 1.22;
  margin: 4px 0;
  color: #e3eded;
}
.clock-row small {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.time-lane {
  height: 15px;
  position: relative;
  background: repeating-linear-gradient(90deg, #f3f5ee18 0 1px, transparent 1px 25%), #182a3a;
  border-radius: 2px;
}
.bar,
.needle {
  position: absolute;
  display: block;
}
.bar {
  height: 7px;
  top: 4px;
  border-radius: 3px;
  min-width: 2px;
  background: #88c8bb;
}
.bar.root {
  background: #eec67a;
}
.bar.failed {
  background: repeating-linear-gradient(115deg, #f2a4a0 0 3px, #a85a62 3px 5px);
}
.bar.waiting {
  background: repeating-linear-gradient(115deg, #d4c4f3 0 3px, #806f9e 3px 5px);
}
.needle {
  top: 0;
  bottom: 0;
  width: 1px;
  background: white;
}
.scrubber {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #e8e6d1;
  border-radius: 8px;
}
.scrubber label {
  font-weight: 900;
}
.scrubber input {
  width: 100%;
  margin: 3px 0;
  accent-color: #476e75;
}
.scrubber span {
  font-size: 0.86rem;
  min-height: 1.25em;
}
.clock-readings span,
.head-result,
.collector-note {
  font-size: 0.9rem;
}
.clock-readings {
  padding: 7px 0;
}
.clock-readings b {
  white-space: nowrap;
  color: #325a5c;
}
.jar-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  border-radius: 10px;
  background: radial-gradient(ellipse at center top, #344b5b, #1b2f42);
  padding: 24px 12px 12px;
  margin: 9px 0;
}
.fire-jar {
  position: relative;
  border: 2px solid #92bbc1;
  background: #52717b44;
  height: 76px;
  width: 64px;
  border-radius: 11px 11px 16px 16px;
  display: grid;
  align-content: end;
  text-align: center;
  color: #e9efd7;
  padding-bottom: 4px;
}
.fire-jar::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 7px;
  right: 7px;
  height: 8px;
  background: repeating-linear-gradient(90deg, #d7bd86 0 3px, #ad9169 3px 5px);
  border-radius: 3px;
}
.fire-jar.full i {
  position: absolute;
  left: 17px;
  top: 18px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffde75;
  box-shadow:
    12px 7px #ffed8c,
    1px 17px #e5c366,
    20px 18px #ffed8c,
    8px -3px 10px 5px #f2de583c;
}
.arrival-cards,
.envelopes {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 9px 0;
}
.arrival-cards button {
  text-align: left;
  flex: 1 1 110px;
}
.arrival-cards button span,
.arrival-cards button small {
  display: block;
  font-size: 0.78rem;
}
.arrival-cards button:disabled {
  opacity: 1;
  background: #e4dfcb;
  color: #5c5c55;
  border-style: dashed;
}
.end-links {
  margin-top: 12px;
  justify-content: flex-start;
}
@media (max-width: 800px) {
  .night-grid,
  .dome-doors {
    grid-template-columns: 1fr;
  }
  .dome-hero {
    display: flex;
    align-items: flex-end;
    padding-top: clamp(190px, 52vw, 320px);
    background:
      linear-gradient(0deg, #202c40 12%, #202c40 36%, transparent 59%),
      url(assets/trace-observatory.webp) center top/100% auto no-repeat,
      #202c40;
  }
  .dome-hero > div {
    width: 100%;
    padding: 16px;
  }
  .dome-hero h1 {
    font-size: clamp(39px, 9vw, 56px);
  }
  .dome-hero p {
    margin: 7px 0 12px;
  }
  .clock-row {
    grid-template-columns: minmax(84px, 0.9fr) minmax(74px, 1.5fr) 42px;
    gap: 3px;
    font-size: 0.72rem;
  }
  .sky-clock {
    padding: 8px;
  }
  .glass-sky {
    height: 260px;
  }
  .fire-star strong {
    font-size: 0.8rem;
  }
  .glass-sky button.fire-star {
    padding: 5px;
  }
  .night-desk button {
    min-height: 40px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .fire-jar.full i {
    animation: glow 2s ease-in-out infinite alternate;
  }
  @keyframes glow {
    from {
      opacity: 0.62;
    }
    to {
      opacity: 1;
    }
  }
}
