:root {
  --bg: #0d0f14;
  --fg: #e8eaed;
  --muted: #9aa3af;
  --accent: #ff5252;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden; /* full-screen globe — never scroll */
  overscroll-behavior: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

#globe {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* fill the mobile viewport, accounting for browser chrome */
  background: #000011;
  z-index: 0;
}

#globe canvas {
  display: block;
  touch-action: none; /* let OrbitControls handle drag/pinch instead of scrolling */
}

/* Full-screen cover shown until data + textures are loaded and the first frame is
   rendered, then faded out. Nothing else is visible behind it until then. */
#loader {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #000011;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

#loader .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

/* Last-deaths feed: short generated personas, floating over the globe just above
   the footer link. Newest sits at the bottom (column-reverse) and is brightest;
   older lines rise and dim. Lets pointer events through to the globe. */
#death-feed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  text-align: center;
  /* Occupy the bottom third of the viewport (a fifth in landscape); the newest
     line sits at the bottom and older lines stack upward, clipped to the band. */
  height: 33.333vh;
  height: 33.333dvh;
  padding-bottom: 2.5rem; /* clear the footer link */
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start; /* with column-reverse, anchors lines to the bottom */
  align-items: center;
  gap: 0.1rem;
  font-size: 1rem;
  line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

@media (orientation: landscape) {
  #death-feed {
    height: 20vh;
    height: 20dvh;
  }
}

.feed-line {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-new {
  color: var(--accent);
  font-weight: 600;
  animation: feed-in 0.4s ease-out;
}

@keyframes feed-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 520px) {
  #death-feed {
    font-size: 0.85rem;
  }
}

/* A quiet link in the bottom corner. It floats over the full-screen globe but
   stays clickable. */
footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  text-align: center;
  padding: 0.75rem;
  pointer-events: none;
}

footer a {
  pointer-events: auto;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

footer a:hover {
  color: var(--fg);
  text-decoration: underline;
}
