:root {
  color-scheme: dark;
  --ink: #090b18;
  --glow: #f8b84e;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 10px;
  color: #f8e7b7;
  font-family: "Lucida Console", "Consolas", "Courier New", monospace;
  background:
    radial-gradient(circle at 50% 42%, rgba(46, 37, 95, 0.32) 0%, rgba(9, 11, 24, 0) 58%),
    radial-gradient(circle at 14% 84%, rgba(121, 63, 148, 0.13) 0%, rgba(9, 11, 24, 0) 34%),
    radial-gradient(circle at 86% 12%, rgba(247, 157, 63, 0.08) 0%, rgba(9, 11, 24, 0) 30%),
    #090b18;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255, 244, 203, 0.8) 0 1px, transparent 1.4px),
    radial-gradient(circle at 76% 14%, rgba(190, 217, 255, 0.7) 0 1px, transparent 1.4px),
    radial-gradient(circle at 31% 76%, rgba(255, 205, 137, 0.45) 0 1px, transparent 1.4px),
    radial-gradient(circle at 88% 69%, rgba(215, 194, 255, 0.55) 0 1px, transparent 1.4px);
  background-size: 257px 223px, 331px 281px, 419px 307px, 197px 263px;
}

#shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#stage {
  position: relative;
  width: min(96vw, 112vh, 1120px);
  aspect-ratio: 960 / 760;
  border-radius: 22px;
  isolation: isolate;
  filter: drop-shadow(0 22px 42px rgba(0, 0, 0, 0.55));
}

#stage::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 32px;
  border: 1px solid rgba(248, 184, 78, 0.16);
  background: linear-gradient(145deg, rgba(36, 31, 64, 0.78), rgba(8, 9, 20, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 206, 0.12),
    0 0 0 6px rgba(4, 5, 13, 0.62);
}

#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 22px;
  pointer-events: none;
  opacity: 0.14;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.045) 0,
    rgba(255, 255, 255, 0.045) 1px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  mix-blend-mode: soft-light;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  outline: none;
  touch-action: none;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

canvas:focus-visible {
  box-shadow: 0 0 0 3px rgba(248, 184, 78, 0.68);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 700px) {
  body {
    padding: 5px;
  }

  #stage {
    width: min(99vw, 112vh);
  }

  #stage::before {
    inset: -5px;
    border-radius: 22px;
  }

  #stage::after,
  canvas {
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #stage {
    filter: none;
  }
}
