@import url('https://fonts.googleapis.com/css2?family=Inknut+Antiqua:wght@300;400&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #07040a;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Inknut Antiqua', Georgia, serif;
  font-weight: 300;
  font-size: clamp(0.7rem, 1dvw, 0.9rem);
  text-transform: lowercase;
  overflow: hidden;
  height: 100dvh;
  width: 100dvw;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.3px;
}

/* === Text buttons (meowrhino style) === */

.text-btn {
  font-family: 'Inknut Antiqua', Georgia, serif;
  font-weight: 300;
  font-size: clamp(0.7rem, 1.1dvw, 0.85rem);
  color: rgba(255, 255, 255, 0.3);
  background: none;
  border: none;
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 0.5px;
  padding: 0.3em 0.1em;
  transition: color 0.2s ease;
}

.text-btn:hover,
.text-btn:active {
  color: rgba(255, 255, 255, 0.6);
}

.text-btn.active {
  color: rgba(255, 255, 255, 0.6);
}

/* === Astrolabe === */

#astrolabe-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100dvw;
  height: 100dvh;
  z-index: 1;
}

#astrolabe-wrapper.flipping canvas {
  animation: fade-flip 0.6s ease-in-out;
}

@keyframes fade-flip {
  0%   { opacity: 1; }
  40%  { opacity: 0; }
  60%  { opacity: 0; }
  100% { opacity: 1; }
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* === Menu tab (always visible at bottom center) === */

#menu-tab {
  position: fixed;
  bottom: 0.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  font-size: clamp(0.8rem, 1.2dvw, 1rem);
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 2px;
  padding: 0.5em 1.5em;
  transition: color 0.2s ease, opacity 0.3s ease;
}

#menu-tab:hover {
  color: rgba(255, 255, 255, 0.5);
}

body.detail-mode #menu-tab,
body.menu-open #menu-tab {
  opacity: 0;
  pointer-events: none;
}

/* === Menu bar (compact bottom bar) === */

.menu-bar {
  position: fixed;
  bottom: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 1.2em;
  align-items: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.menu-bar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

body.detail-mode .menu-bar {
  opacity: 0;
  pointer-events: none;
}

/* === Info panel (above menu bar) === */

.info-panel {
  position: fixed;
  bottom: 2.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 19;
  max-width: 420px;
  width: 90vw;
  padding: 0.8rem 1.2rem;
  background: rgba(7, 4, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.info-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.2rem 0;
}

.info-right {
  text-align: right;
}

.info-astro {
  color: rgba(255, 255, 255, 0.3);
  gap: 1.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 0.2rem;
}

#time-display {
  font-size: 1.05em;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
}

#date-display {
  color: rgba(255, 255, 255, 0.3);
}

#location-name {
  letter-spacing: 1px;
}

#location-coords {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.9em;
}

/* === Magnitude slider === */

.mag-control {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 0.2rem;
}

#mag-label {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85em;
  min-width: 3.5em;
}

#mag-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  outline: none;
}

#mag-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  border: none;
}

#mag-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  border: none;
}

/* === Tema modal === */

.tema-modal {
  position: fixed;
  bottom: 2.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 21;
  display: flex;
  gap: 1em;
  padding: 0.6rem 1rem;
  background: rgba(7, 4, 10, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.tema-modal.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

.tema-option.active {
  color: rgba(255, 255, 255, 0.7);
}

/* === Detail view (zoom overlay) === */

#detail-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100dvw;
  height: 100dvh;
  z-index: 3;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}

#detail-view.hidden {
  opacity: 0;
}

#detail-label {
  position: fixed;
  top: 70%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Inknut Antiqua', Georgia, serif;
  font-size: clamp(5rem, 18dvw, 16rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.04);
  text-transform: lowercase;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#back-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  z-index: 4;
  font-size: clamp(0.7rem, 1.1dvw, 0.85rem);
}

body.detail-mode canvas {
  cursor: grab;
}

body.detail-mode canvas:active {
  cursor: grabbing;
}

/* === Tooltip === */

.tooltip {
  position: fixed;
  z-index: 25;
  background: rgba(7, 4, 10, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 8px 14px;
  font-family: 'Inknut Antiqua', Georgia, serif;
  font-size: clamp(0.65rem, 1vw, 0.8rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  transition: opacity 0.2s ease;
  max-width: 200px;
  text-transform: lowercase;
}

.tooltip.hidden {
  opacity: 0;
}

/* === Visual modes === */

body.night-mode {
  background: #0a0000;
}

body.night-mode .info-panel,
body.night-mode .tema-modal {
  background: rgba(10, 0, 0, 0.92);
  border-color: rgba(255, 40, 40, 0.06);
}

body.night-mode .text-btn {
  color: rgba(255, 60, 60, 0.3);
}

body.night-mode .text-btn:hover,
body.night-mode .text-btn.active {
  color: rgba(255, 60, 60, 0.6);
}

body.night-mode #time-display {
  color: rgba(255, 60, 60, 0.6);
}

body.night-mode #date-display,
body.night-mode #location-coords {
  color: rgba(255, 40, 40, 0.3);
}

body.night-mode .info-astro {
  color: rgba(255, 40, 40, 0.3);
  border-color: rgba(255, 40, 40, 0.06);
}

body.night-mode #location-name {
  color: rgba(255, 60, 60, 0.5);
}

body.night-mode #mag-label {
  color: rgba(255, 40, 40, 0.3);
}

body.night-mode #mag-slider {
  background: rgba(255, 40, 40, 0.1);
}

body.night-mode #mag-slider::-webkit-slider-thumb {
  background: rgba(255, 60, 60, 0.4);
}

body.night-mode .mag-control {
  border-color: rgba(255, 40, 40, 0.06);
}

body.night-mode .tooltip {
  background: rgba(10, 0, 0, 0.92);
  border-color: rgba(255, 40, 40, 0.1);
  color: rgba(255, 60, 60, 0.6);
}

body.night-mode #detail-label {
  color: rgba(255, 40, 40, 0.04);
}

body.night-mode canvas {
  filter: saturate(0) brightness(0.7) sepia(1) hue-rotate(-30deg);
}

body.warm-mode canvas {
  filter: sepia(0.3) brightness(0.95);
}

body.blue-mode canvas {
  filter: brightness(1.1) contrast(1.1) saturate(1.3);
}

/* Green mode — night vision / phosphor */

body.green-mode {
  background: #040a04;
}

body.green-mode canvas {
  filter: hue-rotate(90deg) brightness(0.85) saturate(0.9);
}

body.green-mode .info-panel,
body.green-mode .tema-modal {
  background: rgba(4, 10, 4, 0.92);
  border-color: rgba(40, 160, 40, 0.06);
}

body.green-mode .text-btn {
  color: rgba(60, 200, 60, 0.3);
}

body.green-mode .text-btn:hover,
body.green-mode .text-btn.active {
  color: rgba(60, 200, 60, 0.6);
}

body.green-mode #time-display {
  color: rgba(60, 200, 60, 0.6);
}

body.green-mode #date-display,
body.green-mode #location-coords {
  color: rgba(40, 160, 40, 0.3);
}

body.green-mode .info-astro {
  color: rgba(40, 160, 40, 0.3);
  border-color: rgba(40, 160, 40, 0.06);
}

body.green-mode #location-name {
  color: rgba(60, 200, 60, 0.5);
}

body.green-mode #mag-label {
  color: rgba(40, 160, 40, 0.3);
}

body.green-mode #mag-slider {
  background: rgba(40, 160, 40, 0.1);
}

body.green-mode #mag-slider::-webkit-slider-thumb {
  background: rgba(60, 200, 60, 0.4);
}

body.green-mode .mag-control {
  border-color: rgba(40, 160, 40, 0.06);
}

body.green-mode .tooltip {
  background: rgba(4, 10, 4, 0.92);
  border-color: rgba(40, 160, 40, 0.1);
  color: rgba(60, 200, 60, 0.6);
}

body.green-mode #detail-label {
  color: rgba(40, 160, 40, 0.04);
}

/* === Natal chart detail view === */

.natal-detail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100dvw;
  height: 100dvh;
  z-index: 25;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.natal-detail.hidden {
  opacity: 0;
  pointer-events: none;
}

#natal-detail-label {
  position: fixed;
  top: 70%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Inknut Antiqua', Georgia, serif;
  font-size: clamp(5rem, 18dvw, 16rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.04);
  text-transform: lowercase;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.natal-detail-info {
  position: fixed;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-family: 'Inknut Antiqua', Georgia, serif;
  font-weight: 300;
  text-transform: lowercase;
  pointer-events: none;
}

.natal-detail-info .ndi-position {
  font-size: clamp(1.1rem, 2.5dvw, 1.6rem);
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  margin-bottom: 0.3em;
}

.natal-detail-info .ndi-dignity {
  font-size: clamp(0.8rem, 1.8dvw, 1.1rem);
  color: rgba(255, 215, 120, 0.5);
  margin-bottom: 0.5em;
}

.natal-detail-info .ndi-retro {
  font-size: clamp(0.75rem, 1.5dvw, 0.95rem);
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 0.5em;
}

.natal-detail-info .ndi-sep {
  width: 40px;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0.6em auto;
}

.natal-detail-info .ndi-aspect {
  font-size: clamp(0.7rem, 1.3dvw, 0.85rem);
  color: rgba(255, 255, 255, 0.25);
  line-height: 1.8;
}

#natal-back-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  z-index: 26;
  font-size: clamp(0.7rem, 1.1dvw, 0.85rem);
}

body.natal-detail-mode .menu-bar,
body.natal-detail-mode #menu-tab {
  opacity: 0;
  pointer-events: none;
}

/* Night mode */
body.night-mode #natal-detail-label {
  color: rgba(255, 40, 40, 0.04);
}

body.night-mode .ndi-position {
  color: rgba(255, 60, 60, 0.5) !important;
}

body.night-mode .ndi-dignity {
  color: rgba(255, 140, 80, 0.5) !important;
}

body.night-mode .ndi-sep {
  background: rgba(255, 40, 40, 0.06) !important;
}

body.night-mode .ndi-aspect {
  color: rgba(255, 40, 40, 0.25) !important;
}

/* Green mode */
body.green-mode #natal-detail-label {
  color: rgba(40, 160, 40, 0.04);
}

body.green-mode .ndi-position {
  color: rgba(60, 200, 60, 0.5) !important;
}

body.green-mode .ndi-dignity {
  color: rgba(160, 200, 60, 0.5) !important;
}

body.green-mode .ndi-sep {
  background: rgba(40, 160, 40, 0.06) !important;
}

body.green-mode .ndi-aspect {
  color: rgba(40, 160, 40, 0.25) !important;
}

