:root {
  --bg-zenith: #05060b;
  --bg-horizon: #131a2e;
  --glow: #ff9d5c;
  --ink: #eef1fa;
  --ink-dim: #97a1c2;
  --accent: #ffd58a;
  --card-bg: rgba(12, 16, 30, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-zenith);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 0.5rem;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: 0.02em;
}

.brand-mark {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(255, 213, 138, 0.7);
}

.tagline {
  margin-top: 0.25rem;
  color: var(--ink-dim);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.panels {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  max-width: 980px;
  margin: 0 auto;
}

.panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(10px);
  min-width: 220px;
  flex: 1 1 240px;
}

.panel-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  margin-bottom: 0.4rem;
}

.clock {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.1;
}

.dateline {
  color: var(--ink-dim);
  font-size: 0.9rem;
  margin-top: 0.2rem;
  text-transform: capitalize;
}

.mode-note {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--accent);
  min-height: 1em;
}

.moon-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

#moon-icon {
  border-radius: 50%;
  flex-shrink: 0;
}

.moon-phase-name {
  font-size: 1.05rem;
  font-weight: 500;
}

.moon-illum {
  color: var(--ink-dim);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.planet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.planet-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.planet-list .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.planet-list .empty {
  color: var(--ink-dim);
}

.panel-slider {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

#hour-slider {
  flex: 1;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #1a2340, #3a4a7a, #1a2340);
  outline: none;
  cursor: pointer;
}

#hour-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 213, 138, 0.8);
  cursor: pointer;
}

#hour-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 213, 138, 0.8);
  cursor: pointer;
}

.live-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--ink-dim);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.live-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

.live-btn.is-live {
  color: #7dffb0;
  border-color: rgba(125, 255, 176, 0.35);
}

.tooltip {
  position: fixed;
  z-index: 5;
  display: none;
  pointer-events: none;
  background: rgba(10, 14, 26, 0.92);
  border: 1px solid var(--card-border);
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.compass {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.dir {
  position: absolute;
  color: var(--ink-dim);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

.disclaimer {
  position: absolute;
  bottom: 190px;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-dim);
  opacity: 0.6;
  margin: 0;
  padding: 0 1rem;
}

.skyline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 160px;
  z-index: 1;
  pointer-events: none;
}

.skyline svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 640px) {
  .brand { font-size: 1.4rem; }
  .clock { font-size: 1.6rem; }
  .panel { min-width: 160px; padding: 0.85rem 1rem; }
  .skyline { height: 100px; }
  .disclaimer { bottom: 130px; }
}
