/* 3D Solar System tool — scene canvas, control bar, facts card, attribution. */

.scene-wrap {
  position: relative;
  width: 100%;
  height: min(72vh, 720px);
  min-height: 420px;
  border-radius: 14px;
  overflow: hidden;
  background: #05060a;
  border: 1px solid rgba(120, 140, 200, 0.18);
}

#scene {
  position: absolute;
  inset: 0;
}

#scene canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

.scene-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.fallback-msg {
  max-width: 32rem;
  text-align: center;
  color: #cdd6f4;
  font-size: 1rem;
  line-height: 1.5;
}

.scene-hint {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--muted, #5b6b8c);
  text-align: center;
}

.scene-credit {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted, #5b6b8c);
  text-align: center;
}

.scene-credit a { color: inherit; text-decoration: underline; }

/* --- Time / scale controls --- */
.ss-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.1rem;
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: var(--surface-2, #f3f5ff);
  border: 1px solid rgba(120, 140, 200, 0.18);
}
.ss-btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent, #6a4bff);
  color: #fff;
  transition: filter 0.15s, background 0.15s, border-color 0.15s;
}
.ss-btn:hover { filter: brightness(1.06); }
.ss-btn-ghost {
  background: transparent;
  color: var(--text, #1a2540);
  border-color: rgba(120, 140, 200, 0.4);
}
.ss-btn-ghost[aria-pressed="true"] { background: var(--accent, #6a4bff); color: #fff; border-color: transparent; }
.ss-field { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted, #5b6b8c); }
.ss-field label { font-weight: 600; }
.ss-field input[type="range"] { width: 130px; accent-color: var(--accent, #6a4bff); }
.ss-field input[type="date"] {
  font: inherit;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(120, 140, 200, 0.4);
  background: var(--surface, #fff);
  color: var(--text, #1a2540);
}
.ss-speed { min-width: 8.5ch; font-variant-numeric: tabular-nums; color: var(--text, #1a2540); font-weight: 600; }
.ss-check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; font-weight: 600; color: var(--muted, #5b6b8c); cursor: pointer; }
.ss-check input { accent-color: var(--accent, #6a4bff); }

/* --- Facts card (overlay) --- */
.ss-card {
  position: absolute;
  top: 14px;
  right: 14px;
  width: min(300px, calc(100% - 28px));
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 14px;
  background: rgba(12, 16, 30, 0.82);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  border: 1px solid rgba(150, 170, 230, 0.3);
  color: #eef2ff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}
.ss-card[hidden] { display: none; }
.ss-card-close {
  position: absolute; top: 6px; right: 8px;
  width: 28px; height: 28px; line-height: 1;
  font-size: 1.35rem; cursor: pointer;
  background: transparent; border: 0; color: #aeb9dd;
}
.ss-card-close:hover { color: #fff; }
.ss-card-name { margin: 0 1.5rem 0.3rem 0; font-size: 1.35rem; font-weight: 700; }
.ss-card-blurb { margin: 0 0 0.75rem; font-size: 0.86rem; line-height: 1.45; color: #c3ccec; }
.ss-card-facts { margin: 0; display: grid; gap: 0.28rem; }
.ss-fact { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.86rem; padding: 0.2rem 0; border-bottom: 1px solid rgba(150, 170, 230, 0.12); }
.ss-fact dt { color: #a7b2d6; margin: 0; }
.ss-fact dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.ss-card-approx { margin: 0.6rem 0 0; font-size: 0.76rem; color: #ffd18a; }
.ss-card-more {
  display: inline-block; margin-top: 0.8rem;
  font-weight: 700; font-size: 0.9rem; color: #b9c6ff; text-decoration: none;
}
.ss-card-more[hidden] { display: none; }
.ss-card-more:hover { color: #fff; }

/* --- Beautiful clickable planet table --- */
.planet-table-sub { margin: 0 0 0.85rem; color: var(--muted, #5b6b8c); font-size: 0.9rem; }
.planet-table-wrap { overflow-x: auto; }
.planet-table { min-width: 620px; display: flex; flex-direction: column; gap: 6px; }
.pt-head, .planet-row {
  display: grid;
  grid-template-columns: 1.7fr 0.9fr 1fr 1fr 1fr 0.7fr 1fr 0.5fr;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
}
.pt-head {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted, #5b6b8c);
}
.pt-head span, .planet-row > span { text-align: right; font-variant-numeric: tabular-nums; }
.pt-head .pt-name-h, .planet-row .pt-name { text-align: left; }
.planet-row {
  text-decoration: none;
  color: var(--text, #1a2540);
  border-radius: 12px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e3e7f7);
  font-size: 0.9rem;
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}
.planet-row:hover {
  transform: translateY(-1px);
  border-color: var(--accent, #6a4bff);
  box-shadow: 0 8px 22px rgba(20, 21, 46, 0.12);
}
.pt-name { display: flex; align-items: center; gap: 0.65rem; font-weight: 700; }
.pt-thumb {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; background: #0b0f1e;
  box-shadow: 0 0 0 1px rgba(120, 140, 200, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
  flex: none;
}
.pt-go { color: var(--accent, #6a4bff); font-size: 1.1rem; opacity: 0.55; }
.planet-row:hover .pt-go { opacity: 1; }

@media (max-width: 560px) {
  .ss-field input[type="range"] { width: 96px; }
}
