/* Pixel Perfect DOS Font Rendering */

/* Force pixel-perfect rendering on all elements */
* {
  /* Disable ALL font smoothing */
  -webkit-font-smoothing: none !important;
  -moz-osx-font-smoothing: grayscale !important;
  font-smooth: never !important;
  
  /* Force browsers to render text without antialiasing */
  text-rendering: optimizeSpeed !important;
  
  /* Ensure exact pixel sizes */
  font-size: 16px !important;
  line-height: 16px !important;
  
  /* Prevent any sub-pixel rendering */
  -webkit-text-stroke: 0 !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  
  /* Force integer pixel positioning */
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
}

/* Target specific text elements to ensure coverage */
body, p, div, span, a, h1, h2, h3, h4, h5, h6, 
li, ul, ol, td, th, input, textarea, button, 
pre, code, label, em, strong, b, i, u {
  -webkit-font-smoothing: none !important;
  -moz-osx-font-smoothing: grayscale !important;
  font-smooth: never !important;
  text-rendering: optimizeSpeed !important;
}

/* Images should also be pixelated */
img {
  image-rendering: optimizeSpeed !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: pixelated !important;
  image-rendering: crisp-edges !important;
}

/* Specific fixes for webkit browsers */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  * {
    -webkit-font-smoothing: none !important;
    -webkit-text-size-adjust: none !important;
  }
}

/* For high-DPI displays, force 1:1 pixel rendering */
@media (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) {
  * {
    -webkit-font-smoothing: none !important;
    transform: translateZ(0) scale(1) !important;
  }
}

/* Firefox specific */
@-moz-document url-prefix() {
  * {
    -moz-osx-font-smoothing: grayscale !important;
  }
}

/* Ensure forms don't get smoothed */
input, textarea, select, button {
  -webkit-font-smoothing: none !important;
  -webkit-appearance: none !important;
  font-smooth: never !important;
}