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

html, body, #root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
  font-family: 'Courier New', Courier, monospace;
}

body {
  -webkit-overflow-scrolling: touch;
}

::-webkit-scrollbar {
  display: none;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

.aperture-input {
  background: none;
  border: none;
  outline: none;
  color: #88FF88;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.2em;
  text-align: center;
  width: 80vw;
  max-width: 600px;
  caret-color: #88FF88;
  letter-spacing: 0.05em;
}

.aperture-input::placeholder {
  color: #335533;
  opacity: 1;
}

.aperture-input:focus {
  outline: none;
}

.input-glow {
  animation: inputGlow 3s ease-in-out infinite;
}

@keyframes inputGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(136, 255, 136, 0.03);
  }
  50% {
    box-shadow: 0 0 30px rgba(136, 255, 136, 0.07);
  }
}

.fade-in {
  animation: fadeIn 0.8s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.aperture-line {
  position: fixed;
  top: 50%;
  left: 50%;
  height: 1px;
  background: #88FF88;
  transform: translateX(-50%);
  animation: apertureExpand 300ms ease-out forwards;
  z-index: 100;
}

@keyframes apertureExpand {
  from { width: 0; }
  to { width: 100vw; }
}

.viewport-iframe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}

.overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signature-pixel {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  z-index: 2147483647;
}

.no-aperture-text {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #88FF88;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.4em;
  letter-spacing: 0.15em;
  z-index: 100;
}

.hint-text {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #335533;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.7em;
  letter-spacing: 0.1em;
  z-index: 99997;
  animation: hintFade 4s ease-out forwards;
}

@keyframes hintFade {
  0%, 70% { opacity: 0.6; }
  100% { opacity: 0; }
}

.remix-link {
  position: fixed;
  bottom: 4px;
  left: 4px;
  color: #111111;
  font-family: 'Courier New', Courier, monospace;
  font-size: 9px;
  text-decoration: none;
  z-index: 99997;
  pointer-events: auto;
}

.remix-link:hover {
  color: #222222;
}

.masked-display {
  color: #88FF88;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.2em;
  letter-spacing: 0.05em;
  text-align: center;
  min-height: 1.5em;
  position: relative;
}

.iteration-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  overflow: hidden;
  z-index: 1;
}

.iteration-canvas {
  width: 100%;
  height: 100%;
}

.recursion-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glitch-shift {
  animation: glitchShift 0.05s steps(1) forwards;
}

@keyframes glitchShift {
  0% { transform: translateX(2px); }
  50% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}

.flicker {
  animation: flicker 0.05s steps(1) forwards;
}

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