:root {
  color-scheme: dark;
  --bg: #050606;
  --panel: rgba(14, 17, 18, 0.86);
  --panel-strong: rgba(21, 25, 27, 0.94);
  --line: rgba(230, 224, 190, 0.22);
  --line-strong: rgba(234, 202, 126, 0.62);
  --text: #f0f1e9;
  --muted: #b8b9b1;
  --accent: #d8a93e;
  --accent-soft: rgba(216, 169, 62, 0.18);
  --focus: #eccc7d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  --radius: 22px;
  --icon-size: 34px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: radial-gradient(circle at top left, #1b1b11 0, #090909 34rem, #020303 100%);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 22% 18%, rgba(216, 169, 62, 0.14), transparent 22rem),
    radial-gradient(circle at 84% 28%, rgba(95, 183, 206, 0.12), transparent 26rem),
    var(--bg);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header,
.site-footer,
.layout {
  width: min(1740px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  padding: 34px 0 20px;
}

.header-copy {
  max-width: 1100px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.86rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  font-weight: 650;
}

.lead {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.25rem);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 430px);
  gap: 18px;
  align-items: start;
}

.map-panel,
.index-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.map-panel {
  overflow: hidden;
}

.index-panel {
  max-height: calc(100vh - 30px);
  overflow: auto;
  position: sticky;
  top: 15px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0));
}

.sticky-heading {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel-strong);
  backdrop-filter: blur(14px);
}

.muted {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.reset-button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.58rem 0.9rem;
  color: var(--text);
  background: rgba(216, 169, 62, 0.12);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.reset-button:hover,
.reset-button:focus-visible {
  border-color: var(--focus);
  background: rgba(216, 169, 62, 0.22);
  transform: translateY(-1px);
}

.map-shell {
  position: relative;
  overflow: auto;
  background: #010101;
}

.map-stage {
  position: relative;
  width: 100%;
}

.galaxy-map {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.system-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-point {
  --size: 2.35%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 237, 169, 0.08);
  border-radius: 999px;
  background: rgba(255, 219, 127, 0.01);
  pointer-events: auto;
  outline: 0;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, transform 140ms ease;
}

.map-point--area {
  --size-x: var(--size);
  --size-y: var(--size);
  width: var(--size-x);
  height: var(--size-y);
  aspect-ratio: auto;
  z-index: 1;
}

.map-point:not(.map-point--area) {
  z-index: 3;
}

.map-point--zone {
  border-style: dashed;
  border-color: rgba(97, 207, 226, 0.38);
  background: rgba(97, 207, 226, 0.075);
  box-shadow: inset 0 0 22px rgba(97, 207, 226, 0.12);
}

.map-point::before {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: inherit;
  background: rgba(255, 216, 121, 0.01);
}

.map-point--zone::before {
  inset: 14%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), rgba(97, 207, 226, 0.02));
}

.map-point::after {
  content: attr(data-name);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.35rem);
  transform: translateX(-50%) scale(0.96);
  transform-origin: bottom center;
  min-width: max-content;
  max-width: 18rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff8d9;
  background: rgba(8, 9, 10, 0.88);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  font-size: clamp(0.7rem, 1vw, 0.88rem);
  white-space: nowrap;
}

.map-point:hover,
.map-point:focus-visible,
.map-point.is-highlighted {
  z-index: 10;
  border-color: var(--focus);
  background: rgba(216, 169, 62, 0.18);
  box-shadow: 0 0 0 5px rgba(216, 169, 62, 0.16), 0 0 24px rgba(250, 212, 122, 0.65);
  transform: translate(-50%, -50%) scale(1.25);
}

/* Zonen bleiben auch beim Hover unter den Planetensystemen.
   Dadurch kann ein Planet innerhalb einer Zone direkt angeklickt werden. */
.map-point--area:hover,
.map-point--area:focus-visible,
.map-point--area.is-highlighted {
  z-index: 2;
  transform: translate(-50%, -50%) scale(1.02);
}

.map-point:hover::after,
.map-point:focus-visible::after,
.map-point.is-highlighted::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.controls {
  display: grid;
  gap: 8px;
  padding: 16px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.search-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.search-input,
.category-filter {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 0.72rem 0.82rem;
  color: var(--text);
  background: rgba(3, 4, 5, 0.74);
  outline: 0;
}

.search-input:focus,
.category-filter:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(216, 169, 62, 0.14);
}

.system-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 16px;
}

.system-list-item {
  margin: 0;
}

.system-link {
  display: grid;
  grid-template-columns: var(--icon-size) 1fr;
  gap: 11px;
  align-items: center;
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.035);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.system-link:hover,
.system-link:focus-visible,
.system-link.is-highlighted {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  transform: translateX(2px);
  outline: 0;
}

.category-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  object-fit: contain;
  filter: drop-shadow(0 0 9px rgba(216, 169, 62, 0.18));
}

.system-list-text {
  min-width: 0;
}

.system-name,
.system-category {
  display: block;
}

.system-name {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.system-category {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  color: var(--muted);
  padding: 24px 20px 30px;
  text-align: center;
}

.site-footer {
  padding: 18px 0 34px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer code {
  color: #f7e6ad;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .index-panel {
    position: static;
    max-height: none;
  }

  .system-list {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 680px) {
  .site-header,
  .site-footer,
  .layout {
    width: min(100% - 20px, 1740px);
  }

  .site-header {
    padding-top: 22px;
  }

  .section-heading {
    display: grid;
  }

  .reset-button {
    justify-self: start;
  }

  .map-shell {
    /* Die Karte bleibt groß genug, damit die Klickpunkte auf Mobilgeräten nutzbar sind. */
    min-width: 760px;
  }

  .map-panel {
    overflow-x: auto;
  }
}


/* Detailseite / Lexikon */
.detail-header .eyebrow a,
.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.detail-header .eyebrow a:hover,
.detail-header .eyebrow a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--focus);
  text-decoration: underline;
}

.detail-layout {
  width: min(1740px, calc(100% - 32px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(330px, 520px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.lexicon-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.entry-card-head {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 15px;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0));
}

.entry-icon {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(216, 169, 62, 0.25));
}

.entry-category {
  margin: 6px 0 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.lexicon-text {
  padding: 22px 24px 28px;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
}

.lexicon-text p,
.lexicon-text ul {
  margin: 0 0 1.1rem;
}

.lexicon-text h2,
.lexicon-text h3 {
  margin: 1.3rem 0 0.55rem;
  letter-spacing: -0.015em;
}

.lexicon-text ul {
  padding-left: 1.35rem;
}

.empty-text {
  color: var(--muted);
  font-style: italic;
}

.detail-map-panel {
  min-width: 0;
}

.detail-map-shell {
  max-height: calc(100vh - 210px);
}

.detail-selected-marker {
  border-width: 3px;
}

@media (max-width: 1100px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-map-shell {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .detail-layout {
    width: min(100% - 20px, 1740px);
  }
}
