:root {
  --bg: #07111f;
  --panel: rgba(255,255,255,.075);
  --panel2: rgba(255,255,255,.11);
  --text: #f5f7fb;
  --muted: #aeb9ca;
  --accent: #ffd166;
  --line: rgba(255,255,255,.15);
  --bad: #ffb4a2;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(42, 107, 172, .42), transparent 36rem),
    linear-gradient(145deg, #030712 0%, var(--bg) 55%, #0b1d31 100%);
}
a { color: var(--accent); }
.shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 36px 0 26px; }
.hero {
  text-align: center;
  padding: 32px 18px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
  box-shadow: 0 22px 80px rgba(0,0,0,.35);
}
.brandline { color: var(--muted); font-size: .76rem; letter-spacing: .22em; text-transform: uppercase; }
.planet { font-size: 3rem; margin: 12px 0 2px; }
h1 { margin: 0; font-size: clamp(2.4rem, 8vw, 5rem); line-height: .96; letter-spacing: -.06em; }
.tagline { margin: 12px auto 24px; max-width: 680px; color: #dce6f6; font-size: clamp(1.05rem, 3vw, 1.45rem); }
.search { display: flex; gap: 10px; max-width: 740px; margin: 0 auto; }
.search input, .search button {
  border: 0;
  border-radius: 999px;
  padding: 16px 18px;
  font-size: 1rem;
}
.search input { flex: 1; color: #07111f; background: #fff; min-width: 0; }
.search button { background: var(--accent); color: #1b1300; font-weight: 800; cursor: pointer; }
.hint, .intro { color: var(--muted); max-width: 760px; margin: 18px auto 0; line-height: 1.55; }
.warning { color: var(--bad); margin: 12px auto 0; }
.intro, .status {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  padding: 16px;
}
.status { margin: 18px auto; color: #dce6f6; min-height: 56px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-section { margin-top: 22px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 4px 12px; }
.section-title h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.section-title p { margin: 0; color: var(--muted); text-align: right; }
.tilegrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 14px 45px rgba(0,0,0,.24);
}
.tile.origin { border-color: rgba(255,209,102,.65); }
.tile.twin { background: rgba(99, 179, 237, .08); }
.tile.invalid { opacity: .82; }
.imagewrap { aspect-ratio: 16 / 9; background: rgba(255,255,255,.08); overflow: hidden; }
.imagewrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimage { min-height: 100%; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); }
.noimage.compact { min-height: 120px; color: var(--bad); }
.cardbody { padding: 14px; }
.toprow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.label { margin: 0; color: var(--accent); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: #dce6f6; font-size: .78rem; white-space: nowrap; }
h3 { margin: 8px 0 6px; font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.place, .distance, .coords, .source { margin: 6px 0; color: var(--muted); font-size: .9rem; line-height: 1.35; }
.coords { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.source { color: #d8e9ff; }
.links { display: flex; gap: 12px; margin-top: 10px; font-size: .9rem; }
footer { text-align: center; color: var(--muted); padding: 12px 0 30px; }
@media (max-width: 850px) {
  .tilegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-title { display: block; }
  .section-title p { text-align: left; margin-top: 4px; }
}
@media (max-width: 590px) {
  .shell { width: min(100% - 18px, 1180px); padding-top: 16px; }
  .hero { border-radius: 22px; padding: 24px 12px 18px; }
  .search { flex-direction: column; }
  .search button { width: 100%; }
  .tilegrid { grid-template-columns: 1fr; }
}
