﻿:root {
  --space: #03040c;
  --panel: rgba(12, 13, 31, 0.97);
  --gold: #dfbd79;
  --gold-light: #f5e2b4;
  --purple: #a18aff;
  --text: #f4f0e8;
  --muted: #aaa7bd;
  --border: rgba(191, 163, 224, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0%, #211b42 0%, transparent 45%),
    var(--space);
  font-family: "Montserrat", sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 6%;
  border-bottom: 1px solid var(--border);
  background: rgba(4, 5, 15, 0.92);
}

.logo {
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 20px;
  letter-spacing: 3px;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 23px;
}

nav a {
  color: var(--text);
  font-size: 10px;
  letter-spacing: 1px;
  text-decoration: none;
}

nav a:hover {
  color: var(--gold);
}

.heading {
  padding: 48px 20px 32px;
  text-align: center;
}

.eyebrow,
.section-label {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 2.5px;
}

.heading h1 {
  margin: 12px 0;
  color: var(--gold-light);
  font-family: "Cinzel", serif;
  font-size: clamp(30px, 5vw, 49px);
  font-weight: 400;
}

.heading > p:last-child {
  max-width: 620px;
  margin: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.map-layout {
  display: grid;
  grid-template-columns: 295px minmax(0, 1fr);
  gap: 20px;
  width: min(1600px, 94%);
  margin: 0 auto 60px;
}

.control-panel,
.universe-panel {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.control-panel {
  align-self: start;
  padding: 24px;
}

.panel-section h2 {
  margin: 9px 0;
  color: var(--gold-light);
  font-family: "Cinzel", serif;
  font-size: 20px;
  font-weight: 400;
}

.panel-section > p:not(.section-label) {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.panel-divider {
  height: 1px;
  margin: 23px 0;
  background: var(--border);
}

label {
  display: block;
  margin: 16px 0 7px;
  color: var(--gold-light);
  font-size: 10px;
}

input {
  width: 100%;
  padding: 12px;
  color: white;
  background: #070815;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  font: inherit;
  font-size: 11px;
}

input:focus {
  border-color: var(--gold);
}

button {
  padding: 12px;
  color: #17101e;
  background: linear-gradient(135deg, #f5e2b4, #b68b49);
  border: 0;
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s;
}

button:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

#lookupButton,
.secondary-button {
  width: 100%;
  margin-top: 15px;
}

.secondary-button {
  color: var(--gold-light);
  background: #282044;
  border: 1px solid var(--border);
}

.message {
  min-height: 18px;
  overflow-wrap: anywhere;
}

#lookupMessage {
  color: var(--gold-light);
  font-size: 10px;
  line-height: 1.6;
}

.selected-panel {
  overflow-wrap: anywhere;
}

#starInfo p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.universe-panel {
  display: flex;
  flex-direction: column;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 58px;
  padding: 12px 18px;
  color: var(--gold-light);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  letter-spacing: 1px;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: #72d6a0;
  border-radius: 50%;
  box-shadow: 0 0 9px #72d6a0;
}

.toolbar-buttons {
  display: flex;
  gap: 7px;
}

.toolbar-buttons button {
  width: 36px;
  height: 34px;
  padding: 0;
  color: var(--gold-light);
  background: #211b39;
  border: 1px solid var(--border);
  font-size: 19px;
}

#spaceScene {
  position: relative;
  width: 100%;
  height: min(72vh, 760px);
  min-height: 470px;
  overflow: hidden;
  background: #02030b;
}

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

#loadingOverlay {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  color: var(--gold-light);
  background: #03040c;
  font-size: 11px;
  pointer-events: none;
  transition: opacity 0.8s;
}

.loading-orbit {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(223, 189, 121, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: orbit 1s linear infinite;
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

.map-instructions,
.map-footer {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  color: var(--muted);
  background: #080916;
  border-top: 1px solid var(--border);
  font-size: 8px;
  letter-spacing: 1px;
  line-height: 1.6;
}

.map-footer {
  color: var(--gold);
  background: #0c0c1c;
}

footer {
  padding: 25px;
  color: #88839a;
  border-top: 1px solid var(--border);
  font-size: 10px;
  text-align: center;
}

@media (max-width: 900px) {
  header {
    flex-direction: column;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .control-panel {
    order: 2;
  }

  .universe-panel {
    order: 1;
  }

  #spaceScene {
    height: 60vh;
    min-height: 400px;
  }
}

@media (max-width: 520px) {
  header {
    padding: 18px 12px;
  }

  nav {
    justify-content: center;
    gap: 14px;
  }

  .heading {
    padding: 32px 15px;
  }

  .control-panel {
    padding: 18px;
  }

  #spaceScene {
    min-height: 340px;
    height: 55vh;
  }

  .map-instructions {
    justify-content: center;
  }
}
