/* Sky Map: a dark interface that gets out of the sky's way. */
@font-face { font-family: Inter; font-weight: 400; src: url(../fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; src: url(../fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; src: url(../fonts/inter-latin-600-normal.woff2) format('woff2'); }

:root {
  --bg: #05070f;
  --panel: rgba(12, 16, 30, 0.86);
  --text: #e8ecf5;
  --muted: #9aa3b8;
  --accent: #8fb3ff;
  --line: rgba(255, 255, 255, 0.12);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 400 18px/1.35 Inter, system-ui, sans-serif; overflow: hidden; }
#app { display: flex; flex-direction: column; height: 100%; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.top::-webkit-scrollbar { display: none; }
.wordmark { font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.stage { position: relative; flex: 1; min-height: 0; }
#sky { display: block; width: 100%; height: 100%; touch-action: none; }
.bar { min-height: 64px; padding: 8px 16px; background: var(--panel); border-top: 1px solid var(--line); }

/* Top bar */
.spacer { flex: 1; }
button { font: inherit; color: inherit; cursor: pointer; }
.chip { background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 44px; color: var(--muted); white-space: nowrap; flex: none; }
.chip:hover { color: var(--text); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Overlays over the sky */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 7, 15, 0.72); padding: 24px; }
.overlay[hidden] { display: none; }
.place { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: grid; gap: 14px; }
.place h1 { margin: 0; font-size: 24px; font-weight: 600; }
.place .hint { margin: 0; color: var(--muted); }
.place .row { display: flex; gap: 10px; flex-wrap: wrap; }
.place input { flex: 1 1 140px; min-height: 48px; font-size: 18px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); color: var(--text); }
.primary, .secondary { min-height: 48px; padding: 8px 18px; border-radius: 10px; border: 1px solid var(--line); }
.primary { background: var(--accent); color: #0a1226; border-color: transparent; font-weight: 600; }
.secondary { background: rgba(255,255,255,0.06); }
.error { margin: 0; min-height: 1.4em; color: #ffb4a8; font-size: 16px; }

/* Time bar */
.bar { display: flex; flex-direction: column; gap: 8px; }
.bar .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bar .steps { display: inline-flex; align-items: center; gap: 4px; }
.pill { min-height: 44px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.08); font-weight: 500; }
.icon { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); font-size: 20px; line-height: 1; }
.icon[aria-pressed="true"] { background: var(--accent); color: #0a1226; border-color: transparent; }
#date { min-height: 44px; font-size: 16px; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); color: var(--text); color-scheme: dark; }
.readout { margin-left: auto; font-size: 22px; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; }
.track { position: relative; flex: 1 1 200px; display: flex; align-items: center; min-height: 44px; border-radius: 8px; background: var(--night, transparent); }
#slider { width: 100%; margin: 0; accent-color: var(--accent); min-height: 44px; }
.tick { position: absolute; top: 6px; bottom: 6px; width: 2px; background: #ffd27a; pointer-events: none; }
#speed { min-height: 44px; font-size: 16px; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); color: var(--text); }
@media (max-width: 600px) {
  .wordmark { display: none; }
  .top { padding: 8px 12px; gap: 8px; }
  .chip { padding: 8px 12px; font-size: 16px; }
  .readout { margin-left: 0; width: 100%; font-size: 18px; }
  .pill { padding: 6px 12px; }
  .track { flex-basis: 120px; }
  #speed { padding: 4px 4px; }
}

/* Toggles sheet */
.actions { display: flex; gap: 8px; }
.chip[aria-pressed="true"], .chip[aria-expanded="true"] { background: var(--accent); color: #0a1226; border-color: transparent; }
.sheet-wrap { position: absolute; top: 8px; right: 12px; z-index: 2; }
.sheet-wrap[hidden] { display: none; }
.sheet { width: min(340px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; display: grid; gap: 6px; backdrop-filter: blur(8px); }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.field .label { color: var(--text); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segmented button { min-height: 40px; min-width: 56px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-checked="true"] { background: var(--accent); color: #0a1226; font-weight: 600; }
.switch input { width: 44px; height: 24px; accent-color: var(--accent); margin: 0; }

/* About panel */
.credits { max-height: calc(100% - 16px); overflow: auto; width: min(560px, 100%); font-size: 16px; }
.credits h2 { margin: 6px 0 0; font-size: 18px; }
.credits ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.credits a { color: var(--accent); }
.credits p { margin: 0; }

/* Point mode */
.point-ui { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; pointer-events: none; }
.point-ui[hidden] { display: none; }
.point-ui > * { pointer-events: auto; }
.point-hint { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 16px; max-width: 420px; display: flex; gap: 12px; align-items: center; }
.point-hint button { flex: none; }
.point-note { color: #ffb4a8; font-size: 16px; background: var(--panel); border-radius: 10px; padding: 6px 10px; }

/* Identify chip */
.chip-root { position: absolute; inset: 0; pointer-events: none; }
.idchip { position: absolute; display: grid; gap: 2px; padding: 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: 16px; white-space: nowrap; backdrop-filter: blur(8px); }
.idchip[hidden] { display: none; }
.idchip b { font-weight: 600; font-size: 18px; }
.idchip span { color: var(--muted); }
