/* ── Desktop only: disable text cursor/selection outside inputs ──────────── */
@media (pointer: fine) {
  *:not(input):not(textarea):not([contenteditable]) {
    user-select: none;
    cursor: default;
  }
  input, textarea, [contenteditable] {
    user-select: text;
    cursor: text;
  }
  button, label, a, [role="button"] {
    cursor: pointer;
  }
}

/* ── Splash screen ───────────────────────────────────────────────────────── */
#splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Assistant', sans-serif;
  direction: rtl;
  opacity: 1;
  transition: opacity 0.9s ease;
  pointer-events: none;
}

#splash.fade-out {
  opacity: 0;
}

#splash-moon {
  display: block;
  max-height: 25vh;
  width: auto;
  object-fit: contain;
  animation: splash-moon-pulse 3s ease-in-out infinite;
}

@keyframes splash-moon-pulse {
  0%   { opacity: 0.85; }
  50%  { opacity: 1;    }
  100% { opacity: 0.85; }
}

#splash-clipart {
  margin-top: -30px;
  height: clamp(100px, 18vh, 180px);
  width: auto;
  filter: opacity(0.85);
}

#splash-subtitle {
  margin-top: 15px;
  font-size: 30px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.02em;
}

#splash-sub {
  margin-top: 120px;
  font-size: 22px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.01em;
}

#splash-version {
  margin-top: 12px;
  font-size: 24px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.18);
}

#splash-date {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.18);
}

/* Loading dots */
#splash-loading {
  display: flex;
  gap: 8px;
  margin-top: 28px;
}

#splash-loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  animation: splash-dot 1.2s ease-in-out infinite;
}

#splash-loading span:nth-child(2) { animation-delay: 0.2s; }
#splash-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes splash-dot {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40%            { opacity: 1;   transform: scale(1.2); }
}

#stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
}

/* CSS2DRenderer overlay must also be above stars */
body > div[style*="position: absolute"] {
  z-index: 2;
}

body, html {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  width: 100%;
  height: 100%;
}

/* Scope wrap — hosts canvas + label renderer, transform applied here for flip/rotate */
#scope-wrap {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transform-origin: center center;
  transition: transform 0.3s ease;
}

/* Make sure canvas is above stars */
#moon-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* Telescope selector buttons */
#scope-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.scope-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.4);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.scope-btn:hover {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.3);
}

.scope-btn.active {
  color: #60a5fa;
  border-color: rgba(96,165,250,0.5);
  background: rgba(96,165,250,0.08);
}

.moon-label {
  font-family: Assistant, sans-serif;
  pointer-events: none;
  user-select: none;
  touch-action: none;
  text-align: center;
  opacity: var(--label-opacity, 1);
  transition: opacity 0.3s ease;
  cursor: pointer;
}

/* While measure tool is active, labels must not intercept taps */
body.measuring .moon-label { pointer-events: none !important; }

/* Counter-transform label text so it stays readable when scope is flipped.
   CSS2DRenderer owns the inline transform on .moon-label (for positioning),
   so we must target the child text spans instead. */
body.scope-mirror  .moon-label .heb,
body.scope-mirror  .moon-label .lat  { transform: scaleX(-1); }
body.scope-flip180 .moon-label .heb,
body.scope-flip180 .moon-label .lat  { transform: rotate(180deg); }

.moon-label .heb {
  display: block;
  color: var(--label-color, #fff);
  font-size: calc(var(--label-size, 14) * 0.8px * var(--label-scale, 1));
  font-weight: var(--label-weight, 400);
  font-style: var(--label-italic, normal);
  direction: rtl;
  white-space: nowrap;
  line-height: 1.1;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}

.moon-label .lat {
  display: block;
  font-family: 'Roboto Slab', serif;
  font-size: calc(var(--label-size, 14) * 0.65px * var(--label-scale, 1));
  font-weight: 300;
  color: #ffffff;
  direction: ltr;
  white-space: nowrap;
  line-height: 1.1;
  margin-top: -1px;
  text-shadow: 0 1px 4px rgba(0,0,0,1), 0 0 10px rgba(0,0,0,1);
}

.moon-label .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--label-color, #fff);
  margin: 3px auto 0;
  box-shadow: 0 0 4px var(--label-color, #fff);
}

/* Shift crater labels so the crater rim stays visible */
.moon-label.crater-label {
  margin-top: 10px;
  margin-left: 10px;
}
/* When observe panel is open or flip mode active, remove offset so navigated craters appear centered */
body.observe-open .moon-label.crater-label,
body.flip-active .moon-label.crater-label {
  margin-top: 0;
  margin-left: 0;
}

/* Desktop opacity slider in scope-col */
#label-opacity {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 70px;
  cursor: pointer;
  accent-color: #60a5fa;
}

#reset-opacity {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  padding: 3px 7px;
  font-size: 10px;
  cursor: pointer;
  line-height: 1;
}

#share-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  padding: 5px 8px;
  cursor: pointer;
  line-height: 0;
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#share-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

#share-btn-mobile {
  display: none;
}

#share-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(5, 10, 25, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 9px 20px;
  font-family: 'Assistant', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  direction: rtl;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#share-toast.show {
  opacity: 1;
}

#info-panel {
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 60;
  background: rgba(5, 10, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 20px;
  pointer-events: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  font-family: 'Assistant', sans-serif;
}

.info-coords {
  font-family: 'Roboto Slab', serif;
  font-size: 12px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.06em;
  padding-left: 4px;
  flex-shrink: 0;
}

.info-place {
  display: flex;
  flex-direction: row;
  align-items: center;
  border-left: 1px solid rgba(255,255,255,0.12);
  margin-left: 18px;
  padding-left: 18px;
}

#info-heb {
  font-size: 12px;
  font-weight: 400;
  color: #fff;
  margin-right: 12px;
  direction: rtl;
}

#info-lat-name {
  font-family: 'Roboto Slab', serif;
  font-size: 11px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.38);
  margin-right: 12px;
}

#info-meta {
  font-family: 'Roboto Slab', serif;
  font-size: 11px;
  font-weight: 300;
  color: rgba(96, 165, 250, 0.7);
}

#slider-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 128px;
  background: rgba(5, 10, 20, 0.8);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  z-index: 50;
}

/* Left column: scope buttons */
#scope-col {
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-right: 1px solid rgba(255,255,255,0.07);
  padding: 12px 0;
}

/* Right column: existing sliders */
#sliders-col {
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
}

.panel-label {
  color: rgba(255, 255, 255, 0.35);
  font-size: 9px;
  font-family: Assistant, sans-serif;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#label-scale {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 88px;
  cursor: pointer;
  accent-color: #60a5fa;
}

#reset-scale {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 11px;
  font-family: Assistant, sans-serif;
}

#reset-scale:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

#zoom-display {
  position: fixed;
  bottom: 14px;
  right: 144px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(5, 10, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 5px 10px;
  font-family: 'Roboto Slab', serif;
  font-size: 12px;
  font-weight: 300;
  cursor: text;
  transition: border-color 0.2s;
}

#zoom-display:hover {
  border-color: rgba(96, 165, 250, 0.4);
}

#zoom-display.editing {
  border-color: rgba(96, 165, 250, 0.7);
}

#zoom-label {
  color: rgba(255, 255, 255, 0.3);
  font-family: 'Assistant', sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
}

#zoom-input {
  width: 38px;
  background: none;
  border: none;
  outline: none;
  color: #60a5fa;
  font-family: 'Roboto Slab', serif;
  font-size: 13px;
  font-weight: 400;
  text-align: center;
  -moz-appearance: textfield;
  padding: 0;
  cursor: text;
}

#zoom-input::-webkit-inner-spin-button,
#zoom-input::-webkit-outer-spin-button { -webkit-appearance: none; }

#zoom-unit {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
}

#hint {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.25);
  font-size: 11px;
  font-family: Assistant, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
}

/* Floating moon data panel — toggled by ℹ button, desktop + mobile */
#mobile-moon-panel {
  display: none;
  position: fixed;
  bottom: 230px;
  left: 14px;
  z-index: 60;
  background: rgba(5, 10, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 10px 14px;
  flex-direction: column;
  gap: 7px;
  font-family: 'Assistant', sans-serif;
  direction: rtl;
  min-width: 160px;
  pointer-events: none;
}

#mobile-moon-panel.open {
  display: flex;
}

/* Desktop: hide info button — panel is always visible */
#moon-info-btn { display: none; }

#fullscreen-btn {
  position: fixed;
  bottom: 224px;
  left: 14px;
  z-index: 60;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(5, 10, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.5);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

#fullscreen-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.35);
}

#fullscreen-btn.active {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(96, 165, 250, 0.08);
}

#music-btn {
  position: fixed;
  bottom: 182px;
  left: 14px;
  z-index: 60;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(5, 10, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.35);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

#music-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.35);
}

#music-btn.active {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.08);
}

#measure-btn {
  position: fixed;
  bottom: 140px;
  left: 14px;
  z-index: 60;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(5, 10, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.35);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

#measure-btn:hover:not(:disabled) {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.35);
}

#measure-btn.active {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.08);
}

#measure-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

#night-btn {
  position: fixed;
  bottom: 98px;
  left: 14px;
  z-index: 60;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(5, 10, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

#night-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.35);
}

#night-btn.active {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.08);
}

/* ── Night mode ───────────────────────────────────────────────────────────── */
body {
  transition: filter 0.4s ease;
}
body.night-mode {
  filter: sepia(1) hue-rotate(-40deg) saturate(2.5) brightness(0.45);
}

/* Mobile-only orient button and popup — hidden on desktop */
#orient-btn, #mobile-orient-popup { display: none; }

/* Measure panel */
#measure-panel {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  background: rgba(4, 8, 22, 0.92);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  padding: 12px 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: 'Assistant', sans-serif;
  direction: rtl;
  min-width: 300px;
  pointer-events: auto;
}

#measure-title {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: rgba(251, 191, 36, 0.7);
  text-transform: uppercase;
  margin-bottom: 2px;
}

#measure-pt1,
#measure-pt2 {
  font-family: 'Roboto Slab', serif;
  font-size: 12px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.04em;
  direction: ltr;
}

#measure-pt1 {
  color: rgba(255, 255, 255, 0.5);
}

#measure-dist {
  font-size: 22px;
  font-weight: 600;
  color: #fbbf24;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

#measure-clear {
  margin-top: 6px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.3);
  font-family: 'Assistant', sans-serif;
  font-size: 11px;
  padding: 3px 14px;
  cursor: pointer;
  transition: all 0.15s;
}

#measure-clear:hover {
  color: #fff;
  border-color: rgba(251, 191, 36, 0.4);
}

#mobile-zoom {
  display: none;
}

#auto-rotate-btn {
  position: fixed;
  bottom: 56px;
  left: 14px;
  z-index: 60;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(5, 10, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.35);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

#auto-rotate-btn:hover:not(:disabled) {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.35);
}

#auto-rotate-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

#auto-rotate-btn.active {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(96, 165, 250, 0.08);
  animation: spin-slow 3s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.panel-divider {
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 4px 0;
}

.panel-value {
  color: rgba(255,255,255,0.55);
  font-size: 9px;
  font-family: 'Roboto Slab', serif;
  font-weight: 300;
  letter-spacing: 0.03em;
  min-width: 32px;
  text-align: center;
}

#brightness-slider,
#contrast-slider,
#warmth-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 63px;
  cursor: pointer;
  accent-color: #60a5fa;
}

#warmth-slider {
  accent-color: #fb923c;
}

.reset-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.35);
  border-radius: 3px;
  padding: 2px 5px;
  cursor: pointer;
  font-size: 10px;
  font-family: 'Assistant', sans-serif;
}

.reset-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

#orient-dial {
  touch-action: none;
}
#orient-dial:active {
  cursor: grabbing;
}

#filter-panel {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(5, 10, 20, 0.80);
  border-right: 1px solid rgba(255,255,255,0.07);
  border-radius: 0 8px 8px 0;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 50;
  direction: rtl;
}

.filter-title {
  color: rgba(255,255,255,0.35);
  font-size: 9px;
  font-family: 'Assistant', sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 4px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-family: 'Assistant', sans-serif;
  direction: rtl;
  white-space: nowrap;
  user-select: none;
}

.filter-item input[type="checkbox"] {
  accent-color: #60a5fa;
  width: 13px;
  height: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-item:hover {
  color: #fff;
}

.type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-sub {
  padding-right: 16px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: -2px;
}

/* ── App title ───────────────────────────────────────────────────────────── */
#app-title {
  position: fixed;
  top: 14px;
  right: 144px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  pointer-events: none;
  direction: rtl;
}

.app-title-main {
  font-family: 'Assistant', sans-serif;
  font-size: 19px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
  text-align: right;
  width: 100%;
}

.app-title-sub {
  font-family: 'Assistant', sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.01em;
  text-align: right;
  width: 100%;
}

#visit-counter {
  position: fixed;
  top: 22px;
  right: 310px;
  z-index: 50;
  font-family: 'Changa', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: rgba(245, 239, 199, 0.28);
  letter-spacing: 0.05em;
  pointer-events: none;
  display: flex;
  direction: ltr;
}
.counter-digit {
  height: 36px;
  overflow: hidden;
  line-height: 36px;
}
.counter-reel {
  display: flex;
  flex-direction: column;
}
.counter-reel span {
  display: block;
  height: 36px;
  line-height: 36px;
  text-align: center;
}
body.mobile #visit-counter { display: none; }

/* ── Dev panel ───────────────────────────────────────────────────────────── */
#dev-panel {
  position: fixed;
  top: 60px;
  right: 74px;
  z-index: 200;
  background: rgba(0, 5, 15, 0.93);
  border: 1px solid rgba(255, 220, 100, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
  color: #fff;
  font-family: 'Roboto Slab', serif;
  font-size: 12px;
  font-weight: 300;
  min-width: 260px;
  direction: ltr;
}

.dev-title {
  font-size: 13px;
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 10px;
  font-family: 'Assistant', sans-serif;
}

.dev-title kbd {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: monospace;
}

.dev-section {
  color: rgba(255,220,100,0.6);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 10px 0 6px;
}

.dev-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: rgba(255,255,255,0.7);
  font-size: 11px;
}

.dev-row input[type="range"] {
  flex: 1;
  accent-color: #60a5fa;
  height: 3px;
}

.dev-row span {
  min-width: 36px;
  text-align: right;
  color: #60a5fa;
  font-size: 11px;
}

.dev-copy-btn {
  margin-top: 10px;
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: rgba(255,255,255,0.6);
  font-family: 'Assistant', sans-serif;
  font-size: 12px;
  padding: 5px;
  cursor: pointer;
}

.dev-copy-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ── Phase mode bar ──────────────────────────────────────────────────────── */
#phase-bar {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Assistant', sans-serif;
  direction: rtl;
}

.phase-toggle-btn {
  background: rgba(5, 10, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Assistant', sans-serif;
  font-size: 13px;
  padding: 7px 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.phase-toggle-btn:hover {
  color: #fff;
  border-color: rgba(255, 220, 100, 0.45);
  background: rgba(5, 10, 25, 0.92);
}

#phase-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(5, 10, 25, 0.55);
  border: 1px solid rgba(255, 220, 100, 0.3);
  border-radius: 20px;
  padding: 8px 20px;
  min-width: 280px;
}

#phase-controls-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phase-nav-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phase-nav-btn:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(255, 220, 100, 0.6);
  background: rgba(255, 220, 100, 0.08);
}

.phase-nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

#phase-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  gap: 2px;
}

#phase-name {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

#phase-day {
  color: rgba(255, 220, 100, 0.7);
  font-size: 11px;
  font-family: 'Assistant', sans-serif;
  font-weight: 400;
}

.phase-side-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-right: 6px;
}

.phase-exit-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.35);
  font-family: 'Assistant', sans-serif;
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.phase-exit-btn:hover {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.5);
}

/* Bottom row: darkness + auto-orient side by side */
#phase-controls-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 24px;
  direction: rtl;
}

#darkness-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: rtl;
}


.darkness-label {
  color: rgba(255, 255, 255, 0.45);
  font-family: 'Assistant', sans-serif;
  font-size: 12px;
  white-space: nowrap;
}

#darkness-slider {
  width: 120px;
  accent-color: #444;
  cursor: pointer;
}

/* ── Search box ───────────────────────────────────────────────────────────── */
#search-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  opacity: 0.28;
  transition: opacity 0.25s ease;
  width: 260px;
}

#search-wrap.focused,
#search-wrap:hover {
  opacity: 1;
}

#search-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(5, 10, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  font-family: 'Assistant', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#search-input:focus {
  border-color: rgba(96, 165, 250, 0.6);
  border-radius: 8px 8px 0 0;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-family: 'Assistant', sans-serif;
}

#search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(5, 10, 25, 0.95);
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.search-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.12s;
  direction: rtl;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover,
.search-item.active {
  background: rgba(96, 165, 250, 0.12);
}

.si-heb {
  font-family: 'Assistant', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.si-lat {
  font-family: 'Roboto Slab', serif;
  font-size: 10px;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  direction: ltr;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.si-type {
  font-family: 'Assistant', sans-serif;
  font-size: 10px;
  color: rgba(96, 165, 250, 0.7);
  flex-shrink: 0;
  margin-right: auto;
}

/* ── Welcome overlay ─────────────────────────────────────────────────────── */
#welcome {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Assistant', sans-serif;
  direction: rtl;
  opacity: 0;
  transition: opacity 0.5s ease;
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 20px 0;
  box-sizing: border-box;
}

#welcome.visible {
  opacity: 1;
}

#welcome-box {
  background: rgba(4, 10, 28, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 36px 40px 32px;
  max-width: 560px;
  width: calc(100vw - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

#welcome-logo {
  font-size: 48px;
  line-height: 1;
}

#welcome-title {
  font-size: 38px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin: 0;
  line-height: 1.3;
}

#welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  width: 100%;
}

.wc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.wc-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.wc-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

.wc-text b {
  color: #fff;
  font-weight: 600;
}

#wc-nav {
  display: flex; gap: 12px; justify-content: center; width: 100%;
}
#wc-nav > button {
  flex: 1;
}

#welcome-btn, #wc-prev-btn {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.08));
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 24px;
  color: #fff;
  font-family: 'Assistant', sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 11px 32px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
#welcome-btn:hover, #wc-prev-btn:hover {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.35), rgba(96, 165, 250, 0.15));
  border-color: rgba(96, 165, 250, 0.7);
  transform: translateY(-1px);
}
#wc-prev-btn:disabled {
  opacity: 0.25; cursor: default; transform: none;
}
#wc-finish-btn {
  background: linear-gradient(135deg, rgba(46,204,113,0.25), rgba(46,204,113,0.1));
  border: 1px solid rgba(46,204,113,0.5);
  border-radius: 24px;
  color: #fff;
  font-family: 'Assistant', sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 11px 32px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
#wc-finish-btn:hover {
  background: linear-gradient(135deg, rgba(46,204,113,0.4), rgba(46,204,113,0.2));
  border-color: rgba(46,204,113,0.8);
  transform: translateY(-1px);
}

#welcome-note {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 220, 100, 0.9);
  background: rgba(255, 220, 100, 0.06);
  border: 1px solid rgba(255, 220, 100, 0.15);
  border-radius: 10px;
  padding: 9px 16px;
  text-align: center;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
  animation: note-blink 1.2s ease-in-out infinite;
}

@keyframes note-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* Carousel */
#wc-carousel {
  width: 100%;
  overflow: hidden;
  position: relative;
  height: 300px;
}
.wc-frame {
  display: none;
  flex-direction: column;
  direction: rtl;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}
.wc-frame.active {
  display: flex;
}
.wc-frame.wc-enter-right {
  display: flex;
  position: absolute;
  inset: 0;
  animation: wc-in-right 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.wc-frame.wc-enter-left {
  display: flex;
  position: absolute;
  inset: 0;
  animation: wc-in-left 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.wc-frame.wc-exit-left {
  display: flex;
  position: relative;
  animation: wc-out-left 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}
.wc-frame.wc-exit-right {
  display: flex;
  position: relative;
  animation: wc-out-right 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}
@keyframes wc-in-right  { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes wc-in-left   { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes wc-out-left  { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-100%); opacity: 0; } }
@keyframes wc-out-right { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* Feature frames (tour / ISS) */
.wc-feature-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 16px 32px;
  min-height: 220px;
  justify-content: center;
}
.wc-feature-icon { font-size: 64px; line-height: 1; }
.wc-feature-title {
  font-size: 20px; font-weight: 700; color: #fff;
  margin: 0; text-align: center;
}
.wc-feature-desc {
  font-size: 15px; color: rgba(255,255,255,0.72);
  line-height: 1.65; text-align: center; margin: 0; max-width: 380px;
}

/* NEW badge */
.wc-new-badge {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #041408; font-size: 0.7rem; font-weight: 800;
  padding: 3px 10px; border-radius: 20px;
  letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(46,204,113,0.4);
  align-self: center;
}

.wc-feature-note {
  font-size: 13px; color: rgba(255,220,100,0.85);
  background: rgba(255,220,100,0.06); border: 1px solid rgba(255,220,100,0.15);
  border-radius: 8px; padding: 7px 14px; text-align: center;
  line-height: 1.5; margin: 0; max-width: 380px;
}

/* Dots */
#wc-dots {
  display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;
}
.wc-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.2); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.wc-dot.active {
  background: rgba(96,165,250,0.9);
  transform: scale(1.4);
}

#welcome-no-show {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  user-select: none;
}

#welcome-no-show input[type="checkbox"] {
  accent-color: #60a5fa;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

#welcome-no-show:hover {
  color: rgba(255, 255, 255, 0.7);
}

#welcome-credit {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.18);
  letter-spacing: 0.04em;
}

/* ── Tour offer modal ─────────────────────────────────────────────────────── */
#tour-offer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,10,0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
#tour-offer-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
#tour-offer-box {
  background: rgba(11, 22, 40, 0.82);
  border: 1px solid rgba(140,180,255,0.18);
  border-radius: 16px;
  animation: offer-glow 3.5s ease-in-out infinite;
  padding: 20px;
  max-width: 520px;
  width: 92%;
  color: #dce8ff;
  box-shadow: 0 12px 50px rgba(0,0,0,0.7);
  font-family: 'Assistant', sans-serif;
  direction: rtl;
}
#tour-offer-layout {
  display: flex;
  gap: 18px;
  align-items: center;
}
#tour-offer-img {
  width: 160px;
  min-width: 160px;
  border-radius: 10px;
  display: block;
  order: 2; /* image on left in RTL = order:2 pushes it to visual left */
  flex-shrink: 0;
}
#tour-offer-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: right;
}
#tour-offer-text {
  font-size: 26px;
  line-height: 1.7;
  margin: 0;
  color: rgba(220,232,255,0.92);
}
#tour-offer-checkbox-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: row-reverse;
  gap: 7px;
  font-size: 13px;
  color: rgba(180,205,255,0.65);
  cursor: pointer;
  text-align: right;
  width: 100%;
  margin-top: 14px;
  margin-bottom: 14px;
}
#tour-offer-checkbox-wrap input {
  accent-color: #60a5fa;
  cursor: pointer;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
#tour-offer-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}
#tour-offer-dismiss,
#tour-offer-start {
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13.5px;
  font-family: 'Assistant', sans-serif;
  white-space: nowrap;
  transition: background 0.18s;
  flex-shrink: 0;
}
#tour-offer-dismiss {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  color: rgba(200,220,255,0.8);
}
#tour-offer-dismiss:hover { background: rgba(255,255,255,0.13); }
#tour-offer-start {
  border: 1px solid rgba(74,222,128,0.35);
  background: rgba(74,222,128,0.10);
  color: rgba(74,222,128,0.95);
  font-weight: 600;
  animation: poi-pulse 2.4s ease-in-out infinite;
}
#tour-offer-start:hover { background: rgba(74,222,128,0.20); }

@keyframes offer-glow {
  0%, 100% { box-shadow: 0 12px 50px rgba(0,0,0,0.7), 0 0 0 0 rgba(80,140,255,0); border-color: rgba(140,180,255,0.18); }
  50%       { box-shadow: 0 12px 50px rgba(0,0,0,0.7), 0 0 18px 3px rgba(80,140,255,0.28); border-color: rgba(140,180,255,0.55); }
}

@keyframes tour-btn-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}
.tour-btn-pulsing {
  animation: tour-btn-pulse 1.6s ease-in-out infinite;
}

/* ── Trivia panel ─────────────────────────────────────────────────────────── */
#trivia-panel {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 70;
  background: rgba(4, 8, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px 22px 20px;
  width: 420px;
  max-width: calc(100vw - 120px);
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  direction: rtl;
  font-family: 'Assistant', sans-serif;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  user-select: none;
  cursor: default;
}

#trivia-panel.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

#trivia-close {
  position: absolute;
  top: 10px;
  left: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: color 0.15s;
}

#trivia-close:hover {
  color: rgba(255, 255, 255, 0.8);
}

#trivia-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(96, 165, 250, 0.65);
  margin-bottom: 5px;
  text-transform: uppercase;
}
#trivia-ai-label {
  font-size: 9px;
  opacity: 0.7;
  text-align: center;
  flex: 1;
}

#trivia-name-heb {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 2px;
}

#trivia-name-lat {
  font-family: 'Roboto Slab', serif;
  font-size: 12px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.35);
  direction: ltr;
  text-align: right;
  margin-bottom: 12px;
}

#trivia-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  direction: rtl;
  overflow-y: auto;
  flex: 1;
  padding-bottom: 4px;
}

/* ── Moon data panel (desktop only, top-left) ────────────────────────────── */
#moon-data-panel {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 50;
  background: rgba(5, 10, 20, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-family: 'Assistant', sans-serif;
  direction: rtl;
  pointer-events: none;
  min-width: 148px;
}

.mdp-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mdp-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.mdp-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.06em;
  flex: 1;
}

.mdp-value {
  font-family: 'Assistant', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.mdp-sub {
  font-size: 9px;
  font-family: 'Assistant', sans-serif;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.04em;
}

.mdp-row-date {
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 2px;
}

.mdp-row-date .mdp-value {
  font-family: 'Assistant', sans-serif;
  font-weight: 400;
}

.mdp-accuracy-note {
  font-family: 'Assistant', sans-serif;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 2px;
  direction: rtl;
}

body.mobile #moon-data-panel { display: none; }

#flip-btn, #flip-box { display: none; }

/* ── Filter hint flash ───────────────────────────────────────────────────── */
@keyframes filter-flash-pulse {
  0%, 100% { outline: none;                         color: rgba(255,255,255,0.7); }
  40%       { outline: 2px solid rgba(251,191,36,0.9); color: #fbbf24;           }
}
.filter-flash {
  animation: filter-flash-pulse 0.65s ease-in-out 6;
  border-radius: 4px;
}

.mdp-location-name {
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Assistant', sans-serif;
  font-size: 11px;
  cursor: pointer;
  pointer-events: auto;
  direction: rtl;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
}
.mdp-location-name:hover {
  color: rgba(96, 165, 250, 0.9);
  border-bottom-color: rgba(96, 165, 250, 0.4);
}

/* ── Week button (phase mode only, desktop) ──────────────────────────────── */
#week-btn {
  display: none;
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 60;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(5, 10, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
#week-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.35);
}
#week-btn.active {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.08);
}

/* ── Observe panel + tab ─────────────────────────────────────────────────── */
#observe-panel {
  position: fixed;
  right: 128px;
  top: 0;
  bottom: 0;
  width: 300px;
  background: rgba(4, 9, 18, 0.94);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  z-index: 51;
  /* hidden: shifted right past the slider so nothing bleeds through */
  transform: translateX(calc(100% + 128px));
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  direction: rtl;
  font-family: 'Assistant', sans-serif;
}
#observe-panel.open {
  transform: translateX(0);
}
#observe-panel.obs-panel-faded {
  opacity: 0.22;
  cursor: pointer;
}
#observe-panel.obs-panel-faded:hover {
  opacity: 0.38;
}

/* Tab / lug — fixed, always at the slider's left edge when phase mode active */
#observe-tab {
  display: none;                 /* shown via JS when phase mode active */
  position: fixed;
  top: 50%;
  right: 128px;
  transform: translateY(-50%);
  width: 42px;
  height: 110px;
  background: rgba(4, 9, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-right: none;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  z-index: 52;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.2s, background 0.2s;
}
#observe-tab:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(10, 18, 36, 0.96);
}
#observe-tab.open {
  background: rgba(8, 16, 32, 0.96);
  border-color: rgba(96, 165, 250, 0.2);
  color: rgba(96, 165, 250, 0.8);
}
#observe-tab.obs-tab-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
#observe-tab.obs-tab-disabled:hover {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(6, 10, 26, 0.92);
}
.obs-tab-icon {
  font-size: 14px;
  line-height: 1;
}
.obs-tab-text {
  font-size: 9px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.05em;
  white-space: nowrap;
  font-family: 'Assistant', sans-serif;
}

/* Header */
#obs-hdr {
  position: relative;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
#obs-close-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
#obs-close-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}
#obs-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
  padding-left: 28px;   /* leave room for close btn */
}
#obs-window {
  font-size: 11px;
  color: rgba(96, 165, 250, 0.9);
  line-height: 1.5;
}
#obs-win-note {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 3px;
  line-height: 1.4;
}
#obs-msg {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  padding: 4px 0;
}
#obs-meta {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 5px;
}

/* Filters */
#obs-filters {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#obs-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.obs-type-pill {
  font-size: 10px;
  font-family: 'Assistant', sans-serif;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.obs-type-pill.active {
  background: color-mix(in srgb, var(--pc, #60a5fa) 18%, transparent);
  border-color: color-mix(in srgb, var(--pc, #60a5fa) 55%, transparent);
  color: var(--pc, #60a5fa);
}
.obs-type-pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.75);
}

#obs-filter-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
#obs-eq-filters {
  display: flex;
  gap: 4px;
}
.obs-eq-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  padding: 0;
}
.obs-eq-pill.active {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.4);
  color: rgba(96, 165, 250, 0.9);
}
.obs-eq-pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.75);
}

#obs-sort-btns {
  display: flex;
  gap: 3px;
}
.obs-sort-btn {
  font-size: 10px;
  font-family: 'Assistant', sans-serif;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.obs-sort-btn.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.85);
}
.obs-sort-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.7);
}

/* List */
#obs-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
#obs-list::-webkit-scrollbar {
  width: 3px;
}
#obs-list::-webkit-scrollbar-track {
  background: transparent;
}
#obs-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

.obs-row {
  padding: 6px 14px;
  cursor: default;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}
.obs-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.obs-row-seen .obs-heb::after {
  content: ' ✓';
  font-size: 9px;
  color: rgba(96, 165, 250, 0.5);
}
.obs-row-soon {
  opacity: 0.65;
}

.obs-row-top {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}
.obs-stars {
  font-size: 11px;
  letter-spacing: -2px;
  flex-shrink: 0;
}
.obs-heb {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}
.obs-lat-name {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
}
.obs-week {
  font-size: 10px;
  color: rgba(251, 191, 36, 0.7);
  margin-right: auto;
}
.obs-week.best {
  color: #fbbf24;
  font-weight: 600;
}

.obs-row-bot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.obs-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.obs-type {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
}
.obs-eq {
  display: flex;
  align-items: center;
  gap: 3px;
  color: rgba(255, 255, 255, 0.35);
  margin-right: auto;
}
.obs-eq-icon {
  display: flex;
  align-items: center;
}
.obs-empty {
  padding: 20px 14px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
}

/* Few-craters checkbox — disabled while observe panel is open */
label.obs-cb-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Legend */
#obs-legend {
  flex-shrink: 0;
  padding: 0 14px 14px;
}
.obs-legend-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 8px 0;
}
#obs-legend-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.obs-legend-title {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
}
#obs-legend-toggle {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}
#obs-legend-toggle:hover {
  color: rgba(255, 255, 255, 0.7);
}
.obs-legend-body {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.28);
  line-height: 1.65;
  margin-top: 6px;
}

/* ══════════════════════════════════════════════════════════════
   TOUR MODE
   ══════════════════════════════════════════════════════════════ */

/* Canvas shift during tour */
body.tour-mode #moon-canvas,
body.tour-mode .label-renderer {
  transform: translateX(-25vw);
  transition: transform 0.5s ease;
}

/* UI elements hidden in tour mode */
body.tour-mode #filter-panel,
body.tour-mode #slider-panel,
body.tour-mode #moon-data-panel,
body.tour-mode #search-wrap,
body.tour-mode #phase-bar,
body.tour-mode #hint,
body.tour-mode #tour-btn,
body.tour-mode #app-title,
body.tour-mode .ctrl-btn-group,
body.tour-mode #music-btn,
body.tour-mode #fullscreen-btn,
body.tour-mode #loc-btn,
body.tour-mode #measure-btn,
body.tour-mode #orient-btn,
body.tour-mode #night-btn,
body.tour-mode #auto-rotate-btn,
body.tour-mode #share-btn,
body.tour-mode #week-btn { display: none !important; }

/* Zoom display repositioned to lower-left (above info-panel) in tour mode */
body.tour-mode #zoom-display {
  right: auto;
  left: 14px;
  bottom: 52px;
}

/* Tour launch button */
#tour-btn {
  position: fixed;
  bottom: 14px;
  right: 252px;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.45);
  color: rgba(74, 222, 128, 0.95);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 13px;
  font-family: 'Assistant', sans-serif;
  font-weight: 600;
  cursor: pointer;
  height: 30px;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
  z-index: 50;
  white-space: nowrap;
}
#tour-btn:hover { background: rgba(74, 222, 128, 0.28); border-color: rgba(74, 222, 128, 0.7); }
#tour-btn:disabled { opacity: 0.35; pointer-events: none; }
body.mobile #tour-btn { display: none; }

/* Green glow frame */
#tour-glow-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  box-shadow: inset 0 0 40px 8px rgba(74, 222, 128, 0.45);
  border: 2px solid rgba(74, 222, 128, 0.3);
  opacity: 0;
  transition: opacity 0.5s ease;
}
#tour-glow-frame.visible { opacity: 1; }

/* Tour panel */
#tour-panel {
  position: fixed;
  right: 3vw;
  top: 50%;
  transform: translateY(-50%);
  width: 42vw;
  max-height: 88vh;
  background: rgba(4, 8, 22, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  direction: rtl;
  z-index: 150;
  opacity: 0;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(10px);
  font-family: 'Assistant', sans-serif;
}
#tour-panel.visible { opacity: 1; }

/* Starfield canvas (slide 1) */
#starfield {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 0;
}
#starfield.active { opacity: 1; }
/* All panel children above starfield */
#tour-progress, #tour-header, #tour-subject, #tour-subsubject,
#tour-divider, #tour-pois, #tour-body, #tour-footer {
  position: relative;
  z-index: 1;
}

/* Moon-grow / moon-exit animations (slide 1) */
@keyframes moon-grow {
  from { transform: scale(0.7); }
  to   { transform: scale(1.3); }
}
@keyframes moon-exit {
  from { translate: 0px 0px; }
  to   { translate: -320px 320px; }
}

/* Progress bar */
#tour-progress {
  height: 3px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}
#tour-progress-bar {
  height: 100%;
  background: rgba(74, 222, 128, 0.7);
  width: 0%;
  transition: width 0.35s ease;
}

/* Header */
#tour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
#tour-counter {
  font-size: 16.5px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.06em;
  font-weight: 400;
}
#tour-close, #tour-mute {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
#tour-close:hover, #tour-mute:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.08); }
#tour-mute.muted { color: rgba(255,255,255,0.2); }

/* Subject / subsubject */
#tour-subject {
  font-size: 33px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  padding: 8px 20px 0;
  line-height: 1.25;
  flex-shrink: 0;
}
#tour-subsubject {
  font-size: 19.5px;
  color: rgba(74, 222, 128, 0.8);
  padding: 4px 20px 8px;
  font-weight: 400;
  min-height: 18px;
  flex-shrink: 0;
}

#tour-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 14px 20px 0;
  flex-shrink: 0;
}

/* Scrollable body */
#tour-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#tour-body.no-scroll { overflow: hidden; }
#tour-body::-webkit-scrollbar { width: 4px; }
#tour-body::-webkit-scrollbar-track { background: transparent; }
#tour-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

#tour-slide-content {
  transition: opacity 0.25s ease;
}
#tour-slide-content.fading { opacity: 0; }

/* Main text */
#tour-text {
  font-size: 21.5px;
  font-weight: 300;
  line-height: 1.75;
  color: rgba(255,255,255,0.78);
  margin-bottom: 10px;
  width: 100%;
}

/* Top-level image */
#tour-image {
  display: none;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin-top: 16px;
  align-self: center;
  position: relative;
  top: -150px;
  right: 425px;
  margin-bottom: -150px;
  transform-origin: center center;
}
#tour-image.visible { display: block; }
#tour-image.visible.animated { animation: moon-grow 45s linear forwards; }
#tour-image.visible.animated.exiting {
  animation: moon-grow 45s linear forwards, moon-exit 50s ease-in forwards;
}

/* Credits */
.tour-credit {
  display: none;
  font-size: 10px;
  color: rgba(255,255,255,0.28);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.07);
  text-align: right;
  direction: rtl;
  width: 100%;
}
.tour-credit.visible { display: block; }

/* Video */
#tour-video {
  display: none;
  width: 100%;
  border-radius: 8px;
  margin-top: 12px;
}
#tour-video.visible { display: block; }

/* Sections */
#tour-sections { display: none; width: 100%; }
.tour-section {
  width: 100%;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tour-section:last-child { border-bottom: none; margin-bottom: 0; }
.tour-section.has-credit { border-bottom: none; }
.section-text {
  font-size: 21.5px;
  font-weight: 300;
  line-height: 1.75;
  color: rgba(255,255,255,0.78);
  margin-bottom: 10px;
  white-space: pre-line;
}
.section-image {
  display: block;
  width: 90%;
  max-width: 90%;
  height: auto;
  border-radius: 8px;
  margin: 10px auto 4px;
}
.section-credit {
  font-size: 10px;
  color: rgba(255,255,255,0.28);
  text-align: right;
  direction: rtl;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 4px;
}

/* POI button */
@keyframes poi-pulse {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 0.35; }
}
.poi-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: rgba(74, 222, 128, 0.9);
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 12px;
  font-family: 'Assistant', sans-serif;
  cursor: pointer;
  margin-top: 4px;
  margin-right: 10px;
  animation: poi-pulse 2.4s ease-in-out infinite;
  transition: background 0.15s;
}
.poi-btn:hover { background: rgba(74, 222, 128, 0.22); }
.poi-btn.poi-active {
  animation: none;
  opacity: 0.38;
  cursor: default;
}

/* Top-level POI nav row */
#tour-pois {
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 18px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

/* Footer */
#tour-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  gap: 8px;
}
.tour-nav-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 19.5px;
  font-family: 'Assistant', sans-serif;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tour-nav-btn:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.95); border-color: rgba(255,255,255,0.3); }
.tour-nav-btn:disabled { opacity: 0.25; pointer-events: none; cursor: default; }
/* Next button — always green */
#tour-next {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.35);
  color: rgba(74, 222, 128, 0.9);
}
#tour-next:hover { background: rgba(74, 222, 128, 0.22); color: rgba(74, 222, 128, 1); border-color: rgba(74, 222, 128, 0.6); }
#tour-next.pulsing { animation: tour-next-pulse 1.2s ease-in-out infinite; }
@keyframes tour-next-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}
/* Glow frame slide-1 fast blink */
#tour-glow-frame.blinking { animation: glow-blink 0.6s ease-in-out infinite; }
@keyframes glow-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.15; }
}
/* Finish button — red */
#tour-finish {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  color: rgba(248, 113, 113, 0.85);
  font-family: 'Assistant', sans-serif;
  font-size: 19.5px;
  font-weight: 600;
  padding: 7px 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
#tour-finish:hover { background: rgba(248, 113, 113, 0.18); color: rgba(248, 113, 113, 1); }
