:root {
  color-scheme: dark;
  background: #03020c;
}

* {
  box-sizing: border-box;
}

html,
body,
.scene {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse 90% 70% at 50% 38%, #2a1848 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 18% 78%, #4a1038 0%, transparent 50%),
    radial-gradient(ellipse 55% 45% at 88% 18%, #122050 0%, transparent 48%),
    radial-gradient(circle at 50% 50%, #100a22 0%, #05040e 55%, #02020a 100%);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.scene {
  position: relative;
  isolation: isolate;
}

#space {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.vignette {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 46%, transparent 28%, rgba(2, 2, 12, 0.22) 62%, rgba(0, 0, 6, 0.78) 115%),
    linear-gradient(to bottom, rgba(4, 3, 16, 0.35), transparent 22%, transparent 76%, rgba(1, 1, 8, 0.42));
}

.grain {
  position: absolute;
  z-index: 3;
  inset: 0;
  opacity: 0.028;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

@media (prefers-reduced-motion: reduce) {
  .grain { display: none; }
}
