/* Occupy The Moon — Game Styles */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  overscroll-behavior: none;
  background: #0A0A0A;
  color: #E0E0E0;
  font-family: 'SpaceMono', 'Courier New', 'Courier', monospace;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game-canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

/* Fallback message if canvas fails */
#no-canvas {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #888;
  font-family: monospace;
  font-size: 14px;
  text-align: center;
  padding: 2em;
}

/* Safe area measurement div (hidden) */
#safe-area-measure {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  right: env(safe-area-inset-right, 0px);
  bottom: env(safe-area-inset-bottom, 0px);
  left: env(safe-area-inset-left, 0px);
  pointer-events: none;
  visibility: hidden;
}

/* Film grain overlay (desktop only) */
#grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  background-image: url('../assets/noise.png');
  background-repeat: repeat;
  z-index: 10;
}

/* Scanlines (desktop only) */
@media (min-width: 769px) and (hover: hover) {
  #scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 11;
    background: repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.08) 2px,
      rgba(0, 0, 0, 0.08) 4px
    );
  }
}

/* Hide grain on mobile for performance */
@media (max-width: 768px), (hover: none) {
  #grain-overlay {
    display: none;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
