/* Hero cosmos — deep space backdrop, readable center */
.hero--cosmos {
  position: relative;
  overflow: hidden;
  min-height: min(88vh, 640px);
  padding: 0 !important;
  border: none !important;
  background: #030508;
}

.hero-cosmos-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: auto;
}

#hero-cosmos {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-cosmos-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 55% at 50% 42%, rgba(3, 5, 8, 0.94) 0%, rgba(3, 5, 8, 0.72) 38%, rgba(3, 5, 8, 0.2) 68%, transparent 100%),
    linear-gradient(180deg, rgba(3, 5, 8, 0.55) 0%, transparent 22%, transparent 78%, rgba(3, 5, 8, 0.65) 100%);
}

.hero-cosmos-label {
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  font-family: var(--guide-font);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--green);
  opacity: 0.45;
  pointer-events: none;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 40rem;
  margin: 0 auto;
  padding: 5.5rem 1.25rem 3rem;
}

.hero--cosmos > *:not(.hero-cosmos-wrap) {
  position: relative;
  z-index: 2;
}

.hero--cosmos::before {
  opacity: 0 !important;
  display: none !important;
}

.hero-cosmos-wrap {
  min-height: 100%;
}

@media (max-width: 768px) {
  .hero--cosmos {
    min-height: min(78vh, 520px);
  }

  .hero-content {
    padding-top: 4.5rem;
  }

  .hero-cosmos-vignette {
    background:
      radial-gradient(ellipse 90% 60% at 50% 40%, rgba(3, 5, 8, 0.96) 0%, rgba(3, 5, 8, 0.78) 45%, transparent 100%);
  }
}

.universe-section {
  position: relative;
  z-index: 1;
}

.universe-hero-text {
  margin-bottom: 1rem;
}

.universe-stage {
  position: relative;
  border: 2px solid var(--green);
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(66, 232, 133, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at center, #0a1520 0%, #020408 75%);
  box-shadow:
    var(--glow),
    0 0 60px rgba(66, 232, 133, 0.12),
    inset 0 0 100px rgba(66, 232, 133, 0.05);
  min-height: 520px;
  height: min(72vh, 720px);
}

.universe-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at 30% 20%, rgba(232, 93, 4, 0.04) 0%, transparent 50%);
  border-radius: inherit;
}

#universe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  .universe-stage {
    min-height: min(52vh, 420px);
    height: min(52vh, 420px);
  }

  .universe-hud {
    padding: 0.5rem 0.65rem;
    font-size: 0.7rem;
  }

  .universe-detail {
    max-height: 45%;
    font-size: 0.85rem;
  }

  .planet-hud--compact {
    min-width: 72px;
    font-size: 8px;
    padding: 3px 5px;
  }

  .hero-cosmos-wrap {
    min-height: 200px;
  }

  #hero-cosmos {
    touch-action: none;
  }
}

#universe-canvas:active {
  cursor: grabbing;
}

.universe-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, rgba(4, 10, 8, 0.92), transparent);
  pointer-events: none;
}

.universe-hud > * {
  pointer-events: auto;
}

.universe-hud.hidden {
  display: none;
}

.universe-status {
  font-family: var(--guide-font);
  font-size: 0.75rem;
  color: var(--muted);
  flex: 1;
  min-width: 200px;
}

.universe-status--ok {
  color: var(--green-bright);
}

.universe-status--error {
  color: var(--panic-bright);
}

.universe-hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.universe-detail {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 40%;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  background: linear-gradient(0deg, rgba(4, 10, 8, 0.96), rgba(4, 10, 8, 0.85), transparent);
  border-top: 1px solid var(--border);
  pointer-events: auto;
}

.universe-detail.hidden {
  display: none;
}

.universe-detail h4 {
  font-family: "Orbitron", var(--guide-font);
  color: var(--green-bright);
  margin-bottom: 0.35rem;
}

.universe-detail-type {
  font-family: var(--guide-font);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--vogon);
  margin-bottom: 0.5rem;
}

.universe-detail-addr {
  font-family: var(--mono);
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--purple);
  margin-bottom: 0.5rem;
}

.universe-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.universe-legend-item {
  padding: 0.65rem 0.85rem;
  font-family: var(--guide-font);
  font-size: 0.75rem;
}

.universe-legend-item strong {
  color: var(--green-bright);
  display: block;
  margin-bottom: 0.2rem;
}

.universe-wallets-panel {
  margin-top: 1.25rem;
}

.universe-wallets-list {
  list-style: none;
  font-family: var(--guide-font);
  font-size: 0.8rem;
  max-height: 200px;
  overflow-y: auto;
}

.universe-wallets-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.universe-backend-note {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border);
  font-family: var(--guide-font);
  font-size: 0.78rem;
  color: var(--muted);
}

.universe-backend-note code {
  color: var(--green-bright);
}

.universe-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.universe-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-family: var(--guide-font);
  font-size: 0.82rem;
}

.universe-stats-bar.hidden {
  display: none;
}

.universe-stats__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.universe-stats__lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.universe-stats__item strong {
  font-family: var(--mono);
  color: var(--green-bright);
  font-size: 0.95rem;
}

.universe-stats__val--up {
  color: var(--green-bright) !important;
}

.universe-stats__val--down {
  color: var(--panic-bright) !important;
}

.planet-hud {
  font-family: var(--guide-font);
  font-size: 9px;
  letter-spacing: 0.03em;
  color: #c8e6d4;
  background: rgba(4, 12, 10, 0.92);
  border: 1px solid rgba(66, 232, 133, 0.4);
  border-radius: 8px;
  padding: 5px 7px;
  min-width: 118px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 14px rgba(66, 232, 133, 0.12);
  transform: translate(-50%, -100%);
  backdrop-filter: blur(6px);
}

.planet-hud__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
}

.planet-hud__title {
  font-weight: 700;
  color: var(--green-bright);
  font-size: 10px;
}

.planet-hud__tier {
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(66, 232, 133, 0.12);
  color: #9ab0a4;
  white-space: nowrap;
}

.planet-hud__tier--mega,
.planet-hud__tier--city {
  color: #e8c04a;
  background: rgba(232, 192, 74, 0.15);
}

.planet-hud__row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 4px;
  margin: 3px 0;
}

.planet-hud__lbl {
  font-size: 7px;
  text-transform: uppercase;
  color: #7a9a88;
}

.planet-hud__compact-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 8px;
  margin-top: 2px;
}

.planet-hud__bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.planet-hud__fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.planet-hud__fill--pop {
  background: linear-gradient(90deg, #2a8f5a, #42e885);
  box-shadow: 0 0 6px rgba(66, 232, 133, 0.5);
}

.planet-hud__fill--mcap {
  background: linear-gradient(90deg, #6b4a12, #e8c04a);
}

.planet-hud__fill--mood.planet-hud__mood--up {
  background: linear-gradient(90deg, #1a6b42, #42e885);
}

.planet-hud__fill--mood.planet-hud__mood--down {
  background: linear-gradient(90deg, #5a2010, #e85d04);
}

.planet-hud__val {
  font-size: 8px;
  color: #9ab0a4;
  min-width: 28px;
  text-align: right;
}

.planet-hud__mood {
  text-align: center;
  font-size: 8px;
  margin-top: 2px;
  font-weight: 600;
}

.planet-hud__mood--up {
  color: #42e885;
}

.planet-hud__mood--down {
  color: #e85d04;
}

.universe-stat-bars {
  margin: 0.5rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.universe-stat-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.stat-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar__fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.stat-bar__fill--pop {
  background: linear-gradient(90deg, #1a6b42, #42e885);
}

.stat-bar__fill--mcap {
  background: linear-gradient(90deg, #665500, #ffd700);
}

.stat-bar--up {
  background: linear-gradient(90deg, #2a5a3a, #42e885);
}

.stat-bar--down {
  background: linear-gradient(90deg, #5a2010, #e85d04);
}

.universe-detail-tier {
  font-size: 0.78rem;
  color: var(--vogon);
  margin-bottom: 0.5rem;
}

.universe-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem 0.75rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.universe-detail-grid strong {
  color: var(--text);
  font-family: var(--mono);
}

.helios-holders {
  color: var(--green-bright);
  font-variant-numeric: tabular-nums;
}
