:root {
  --ink-dim: #d8c9b4;
  --hint-size: 11px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background-color: #110d0b;
  background-image: radial-gradient(circle at 50% 58%, #211713 0%, #130e0c 55%, #0d0908 100%);
  color: var(--ink-dim);
  font-family: "Space Mono", monospace;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  overscroll-behavior: none;
  cursor: default;
}

#scene {
  position: fixed;
  inset: 0;
}

#scene canvas {
  display: block;
  cursor: inherit;
}

body.is-hovering-match {
  cursor: grab;
}

body.is-dragging {
  cursor: grabbing;
}

body.is-carrying-flame {
  cursor: none;
}

.grain {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  opacity: 0.026;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  animation: grain-drift 24s steps(8, end) infinite;
  z-index: 3;
}

@keyframes grain-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(-3%, 2%, 0);
  }
  50% {
    transform: translate3d(2%, -2%, 0);
  }
  75% {
    transform: translate3d(-2%, -3%, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    ellipse 82% 74% at 50% 56%,
    rgba(0, 0, 0, 0) 42%,
    rgba(6, 4, 3, 0.45) 78%,
    rgba(4, 3, 2, 0.78) 100%
  );
}

.hint {
  position: fixed;
  margin: 0;
  padding: 0;
  font-size: var(--hint-size);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: #e9dcc6;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition: opacity 1.1s ease;
  z-index: 4;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.6);
}

.hint.is-visible {
  opacity: 0.4;
}

.hint--strike.is-visible {
  opacity: 0.34;
}

.hint--empty.is-visible {
  opacity: 0.26;
}

.hint--noscript {
  top: 50%;
  left: 50%;
  opacity: 0.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

  .hint {
    transition-duration: 0.35s;
  }
}
