/* Retro 8/16-bit theme: login, busy/hazard page, and the landing page's
   one-time intro overlay (loading bar + hyperjump). Black/white only. */

@font-face {
  font-family: "Press Start 2P";
  src: url("/fonts/press-start-2p.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.theme-retro {
  font-family: "Press Start 2P", monospace;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 3px),
    #000;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.retro-stage {
  width: 100%;
  max-width: 460px;
  text-align: center;
}

.retro-logo {
  width: 72px;
  height: 45px;
  margin: 0 auto 20px;
}

.retro-title {
  font-size: 18px;
  letter-spacing: 3px;
  line-height: 1.6;
  margin: 0 0 28px;
}

.pixel-panel {
  background: #000;
  border: 4px solid #fff;
  box-shadow: 8px 8px 0 0 #fff;
  padding: 28px 24px;
  text-align: left;
}

.pixel-field {
  margin-top: 18px;
}

.pixel-field label {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.pixel-field input {
  width: 100%;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  background: #000;
  color: #fff;
  border: 3px solid #fff;
  padding: 10px;
}

.pixel-button {
  display: block;
  width: 100%;
  margin-top: 26px;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  letter-spacing: 1px;
  background: #000;
  color: #fff;
  border: 4px solid #fff;
  padding: 14px 20px;
  box-shadow: 6px 6px 0 0 #fff;
}

.pixel-button:hover {
  background: #151515;
}

.pixel-button:active {
  transform: translate(6px, 6px);
  box-shadow: none;
}

.pixel-error {
  font-size: 11px;
  line-height: 1.7;
  border-left: 4px solid #fff;
  padding-left: 10px;
  margin: 0 0 18px;
}

/* --- Busy / hazard page ------------------------------------------------ */

.hazard-icon {
  width: 108px;
  height: 98px;
  margin: 0 auto 22px;
}

.retro-body-text {
  font-size: 11px;
  line-height: 2;
  letter-spacing: 0.5px;
}

.retro-body-text strong {
  color: #fff;
}

/* --- Intro overlay (loading bar + hyperjump), lives on the landing page - */

.intro-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.intro-overlay .loading-stage {
  font-family: "Press Start 2P", monospace;
  text-align: center;
}

.intro-overlay .jump-stage {
  position: absolute;
  inset: 0;
  display: none;
}

.intro-overlay.jumping .loading-stage {
  display: none;
}

.intro-overlay.jumping .jump-stage {
  display: block;
}

.loading-text {
  font-size: 13px;
  letter-spacing: 2px;
  animation: blink 0.6s steps(1) infinite;
}

.loading-bar {
  width: 280px;
  height: 22px;
  border: 4px solid #fff;
  margin: 18px auto 0;
  padding: 3px;
}

.loading-bar .fill {
  height: 100%;
  width: 0%;
  background-image: repeating-linear-gradient(90deg, #fff 0 14px, transparent 14px 18px);
  animation: fillBar 1.2s steps(12) forwards;
}

.jump-stage .streak {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--len);
  height: var(--w);
  margin-top: calc(var(--w) / -2);
  /* Bright leading head, fading tail - the star is travelling outward (to the right of its
     own rotated axis), so the solid end must be the outer one. */
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 65%, #fff 100%);
  border-radius: var(--w);
  transform-origin: left center;
  opacity: 0;
  will-change: transform, opacity;
  animation: warp var(--dur) cubic-bezier(0.5, 0, 1, 0.5) var(--d) forwards;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes fillBar {
  to {
    width: 100%;
  }
}

/* rotate() first, then translateX() - so the translation runs along the star's own radial
   axis, and scaleX() stretches it along that same axis as it accelerates outward.
   90vmax always exceeds the viewport's half-diagonal, so every star clears the screen. */
@keyframes warp {
  0% {
    transform: rotate(var(--a)) translateX(var(--r0)) scaleX(0.12);
    opacity: 0;
  }
  12% {
    opacity: var(--o);
  }
  100% {
    transform: rotate(var(--a)) translateX(90vmax) scaleX(1);
    opacity: 0;
  }
}
