*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: #000;
  overflow: hidden;
  user-select: none;
  cursor: crosshair;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.x-link {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: rgba(232, 232, 232, 0.28);
  transform: translateX(-50%);
  transition: color 0.45s ease, opacity 0.45s ease;
  cursor: pointer;
}

.x-link:hover,
.x-link:focus-visible {
  color: rgba(232, 232, 232, 0.85);
  outline: none;
}

.x-link svg {
  width: 14px;
  height: 14px;
  display: block;
}

.ca {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 10;
  max-width: calc(100vw - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(232, 232, 232, 0.22);
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  transition: color 0.45s ease;
  cursor: pointer;
}

.ca:hover,
.ca:focus-visible {
  color: rgba(232, 232, 232, 0.7);
  outline: none;
}

.ca.copied {
  color: rgba(232, 232, 232, 0.85);
}

@media (max-width: 600px) {
  .ca {
    font-size: 5px;
    letter-spacing: 0.06em;
  }
}

.beam,
.scanlines,
.grain,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.beam {
  height: 30vh;
  top: -30vh;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.018) 50%,
    transparent
  );
  animation: beam 9s linear infinite;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0,
    rgba(0, 0, 0, 0.35) 1px,
    transparent 1px,
    transparent 3px
  );
  animation: flicker 0.12s infinite;
}

.grain {
  inset: -50%;
  opacity: 0.06;
  animation: grain 0.6s steps(6) infinite;
}

.vignette {
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.92) 100%);
}

@keyframes beam {
  from { transform: translateY(0); }
  to { transform: translateY(160vh); }
}

@keyframes flicker {
  0% { opacity: 0.85; }
  50% { opacity: 1; }
  100% { opacity: 0.9; }
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-7%, 4%); }
  40% { transform: translate(5%, -9%); }
  60% { transform: translate(-3%, 8%); }
  80% { transform: translate(9%, 2%); }
  100% { transform: translate(-5%, -4%); }
}

@media (prefers-reduced-motion: reduce) {
  .beam,
  .scanlines,
  .grain {
    animation: none;
  }
}
