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

:root {
  --bg: #000;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --theme-color: #000;
  --edge: clamp(2.5rem, 6vw, 4.5rem);
  --text-color: var(--text);
  --btn-color: var(--muted);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Courier Prime', monospace;
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

input {
  accent-color: var(--muted);
}

a {
  color: var(--muted);
  text-decoration: none;
}

a:hover {
  color: var(--text);
}

#content {
  position: relative;
  width: 100dvw;
  height: 100dvh;
}

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
  font-family: inherit;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  letter-spacing: 0.1em;
  z-index: 100;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}

#loading.hidden {
  opacity: 0;
}

.loading-dots {
  display: inline-block;
  margin-left: 0.3em;
}

.loading-dots span {
  display: inline-block;
  animation: loading-blink 1.4s infinite both;
}

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

@keyframes loading-blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

.celda {
  position: absolute;
  inset: 0;
  background: var(--bg);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.celda.activa {
  opacity: 1;
  pointer-events: auto;
}

/* Tono base por panel (se usa para meta[name="theme-color"] del navegador) */
.centro { --theme-color: #000000; }
.norte  { --theme-color: #03060d; }
.sur    { --theme-color: #0a0a14; }
.este   { --theme-color: #0e0a05; }
.oeste  { --theme-color: #0d0508; }

.contenido {
  width: 100%;
  height: 100%;
  padding: var(--edge);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
}

.boton-nav {
  position: absolute;
  z-index: 3;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: clamp(0.9rem, 2dvw, 1.6rem);
}

.boton-nav:hover,
.boton-nav:focus-visible {
  color: var(--text);
  outline: none;
}

.btn_arriba {
  top: 2.5dvh;
  left: 50%;
  transform: translateX(-50%);
}

.btn_abajo {
  bottom: 2.5dvh;
  left: 50%;
  transform: translateX(-50%);
}

.btn_derecha {
  right: 2dvw;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.btn_izquierda {
  left: 2dvw;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.ascii-container {
  white-space: pre;
  line-height: 1;
  font-size: clamp(0.55rem, 1.2vw, 0.95rem);
  max-width: 100%;
  text-align: center;
}

.ascii-large {
  font-size: clamp(0.7rem, 1.6vw, 1.25rem);
}

.ascii-diagram {
  margin: 0;
  display: inline-block;
  text-align: left;
  letter-spacing: 0;
  font-variant-ligatures: none;
}

.ascii-meta {
  font-size: clamp(0.7rem, 1.6vw, 1rem);
  color: var(--muted);
  white-space: pre-line;
}

.info-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  max-width: min(80%, 42rem);
}

/* Paneles de cielo/sol/luna: sin padding, llenan toda la pantalla */
.norte .contenido,
.sur .contenido,
.este .contenido,
.oeste .contenido {
  padding: 0;
}

.norte .info-panel,
.sur .info-panel,
.este .info-panel,
.oeste .info-panel {
  max-width: 100%;
  width: 100%;
  height: 100%;
}

.info-title {
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  margin: 0;
}

/* Mensaje cuando el panel no aplica (norte de día, sur de noche) */
.inactivo-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  padding: var(--edge);
}

.inactivo-titulo {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  color: var(--text);
}

.inactivo-mensaje {
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: var(--muted);
  white-space: pre-line;
  line-height: 1.6;
}

/* Centro: título grande + datos */
.centro .contenido {
  justify-content: center;
  position: relative;
}

.centro-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.centro-titulo {
  margin: 0;
  font-size: clamp(2rem, 11vw, 6rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
}

.centro-sub {
  font-size: clamp(0.9rem, 2.2vw, 1.2rem);
  color: var(--muted);
  letter-spacing: 0.15em;
}

.centro-stack {
  position: absolute;
  left: 50%;
  bottom: var(--edge);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
}

.centro-subtitle,
.centro-link {
  font-size: clamp(0.8rem, 2vw, 1.1rem);
  color: var(--muted);
}

.centro-link:hover {
  color: var(--text);
}

/* Nombres de constelaciones */
.constellation-name:hover {
  opacity: 0.9 !important;
  color: var(--text) !important;
}

/* Mobile: botones laterales más pequeños y más al borde para evitar
   solaparse con el título grande del centro. Centro alineado arriba. */
@media (max-width: 600px) {
  .boton-nav {
    font-size: clamp(0.85rem, 3.5vw, 1.1rem);
  }
  .btn_derecha {
    right: 0.5dvw;
  }
  .btn_izquierda {
    left: 0.5dvw;
  }
  .centro .contenido {
    justify-content: flex-start;
    padding-top: clamp(4rem, 18vh, 8rem);
  }
  .centro-stack {
    bottom: 4rem;
  }
}
