/* ── Contenedor 3D ───────────────────────────────────────────────────────── */

.eclipse3d-shell {
  position: relative;
  height: 74vh;
  min-height: 500px;
  max-height: 820px;
  border: 1px solid var(--at-border, #223140);
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #10202c 0%, #060a10 75%);
  width: 100%;
  margin: 1rem 0 0.5rem;
  box-shadow: var(--at-shadow, 0 22px 60px rgba(0, 0, 0, 0.4));
}

@media (min-width: 900px) {
  .eclipse3d-shell {
    left: 50%;
    margin-left: calc(-50vw + 24px);
    margin-right: calc(-50vw + 24px);
    position: relative;
    width: calc(100vw - 48px);
  }
}

#eclipse3d-mount {
  position: absolute;
  inset: 0;
}

#eclipse3d-mount canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#eclipse3d-mount canvas:active {
  cursor: grabbing;
}

.eclipse3d-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  color: var(--at-muted, #a9b9c6);
  font-size: 0.92rem;
  pointer-events: none;
}

.eclipse3d-status:empty {
  display: none;
}

/* ── Panel de control ────────────────────────────────────────────────────── */

.eclipse3d-panel {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  background: rgba(9, 14, 20, 0.88);
  border: 1px solid var(--at-border, #223140);
  border-radius: 10px;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.eclipse3d-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.eclipse3d-row + .eclipse3d-row {
  margin-top: 8px;
}

.eclipse3d-slider {
  flex: 1 1 100%;
  accent-color: var(--at-accent, #f2b23c);
  cursor: pointer;
}

.eclipse3d-btn {
  color: var(--at-text, #eef3f7);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--at-border, #223140);
  border-radius: 7px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.eclipse3d-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.eclipse3d-btn[aria-pressed="true"] {
  border-color: var(--at-accent-2, #3aa7c9);
  background: rgba(58, 167, 201, 0.16);
}

.eclipse3d-speedgroup {
  display: flex;
  gap: 4px;
}

.eclipse3d-viewgroup {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.eclipse3d-control-label {
  color: var(--at-muted, #a9b9c6);
  font-size: 0.78rem;
}

.eclipse3d-scale {
  color: var(--at-muted, #a9b9c6);
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: right;
  max-width: 34rem;
}

.eclipse3d-spacer {
  flex: 1 1 auto;
}

.eclipse3d-readout {
  font-size: 0.8rem;
  color: var(--at-muted, #a9b9c6);
  line-height: 1.4;
}

.eclipse3d-readout strong {
  color: var(--at-text, #eef3f7);
  font-weight: 700;
}

.eclipse3d-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--at-muted, #a9b9c6);
}

.eclipse3d-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.eclipse3d-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .eclipse3d-row {
    flex-wrap: nowrap;
  }

  .eclipse3d-slider {
    flex: 1 1 auto;
  }
}

@media (max-width: 639px) {
  .eclipse3d-shell {
    height: auto;
    min-height: 0;
    max-height: none;
    padding-top: 400px;
  }

  #eclipse3d-mount {
    bottom: auto;
    height: 400px;
  }

  .eclipse3d-status {
    bottom: auto;
    height: 400px;
  }

  .eclipse3d-panel {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 0 10px 10px;
    padding: 8px;
  }

  .eclipse3d-viewrow {
    align-items: flex-start;
  }

  .eclipse3d-scale {
    flex: 1 1 100%;
    max-width: none;
    text-align: left;
  }

  .eclipse-scale-figure {
    overflow-x: auto;
    padding-bottom: 0.35rem;
  }

  .eclipse-scale-figure svg {
    min-width: 680px;
  }
}

/* ── Créditos ─────────────────────────────────────────────────────────────── */

.eclipse3d-credit {
  color: var(--at-muted, #a9b9c6);
  font-size: 0.85rem;
  margin: 0.6rem 0 1.4rem;
}

/* ── Figura física a escala ─────────────────────────────────────────────── */

.eclipse-scale-figure {
  max-width: 760px;
  margin: 1.25rem auto;
}

.eclipse-scale-figure svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: inherit;
  background: rgba(6, 10, 16, 0.45);
  border: 1px solid var(--at-border, #223140);
  border-radius: 10px;
}

.eclipse-scale-figure figcaption {
  margin-top: 0.55rem;
  color: var(--at-muted, #a9b9c6);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
}
