/* Pixel Quest — background FX layers (8-bit arcade) */

.mh-pixel-field {
  position: fixed;
  inset: 0;
  z-index: -4;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: opacity 0.45s ease;
}

.mh-pixel-scan {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  opacity: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.16) 0,
    rgba(0, 0, 0, 0.16) 2px,
    transparent 2px,
    transparent 4px
  );
}

.mh-arcade-marquee {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9996;
  height: 28px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #ff3864, #ffa300, #ffcd75, #00e436, #29adff, #ff3864);
  background-size: 200% 100%;
  animation: px-marquee-bg 4s linear infinite;
  border-bottom: 4px solid #0d0221;
}

.mh-arcade-marquee__track {
  display: flex;
  white-space: nowrap;
  animation: px-marquee-scroll 18s linear infinite;
  font-family: "Press Start 2P", monospace;
  font-size: var(--px-fs-sm);
  line-height: 28px;
  color: #0d0221;
  letter-spacing: 0.08em;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}

.mh-arcade-marquee__track span {
  padding: 0 2.5rem;
}

.mh-pixel-confetti {
  position: fixed;
  inset: 0;
  z-index: 10060;
  pointer-events: none;
  overflow: hidden;
}

.mh-pixel-confetti__bit {
  position: absolute;
  width: 8px;
  height: 8px;
  image-rendering: pixelated;
  animation: px-confetti-fall 1.4s steps(12) forwards;
}

@keyframes px-marquee-bg {
  to { background-position: 200% 0; }
}

@keyframes px-marquee-scroll {
  to { transform: translateX(-50%); }
}

@keyframes px-confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0;
  }
}

/* Hide Spacemonkey / Aurora layers when Pixel Quest is active */
html[data-theme="pixelquest"] .mh-starfield,
html[data-theme="pixelquest"] .mh-vignette,
html[data-theme="pixelquest"] .mh-scanlines,
html[data-theme="pixelquest"] .mh-bg,
html[data-theme="pixelquest"] .mh-grid {
  opacity: 0 !important;
  visibility: hidden;
}

html[data-theme="pixelquest"] .brand-mark__ring,
html[data-theme="pixelquest"] .brand-mark__ghost {
  display: none !important;
}

html[data-theme="pixelquest"] .mh-pixel-field,
html[data-theme="pixelquest"] .mh-pixel-scan {
  opacity: 1;
}

html[data-theme="pixelquest"] .mh-arcade-marquee {
  opacity: 1;
}

html[data-theme="pixelquest"] body {
  padding-top: 28px;
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="pixelquest"] .mh-arcade-marquee,
  html[data-theme="pixelquest"] .mh-arcade-marquee__track {
    animation: none;
  }
}
