* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #08070d;
  background-image: radial-gradient(circle at center, #1b162b 0%, #08070d 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Tiny5', 'Press Start 2P', monospace;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 450px;
  max-height: 800px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 100, 50, 0.15);
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

canvas#gameCanvas {
  display: block;
  /* Pixel-perfect crisp scaling */
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: none; /* Prevent scroll/zoom on mobile touch gestures */
}

/* Subtle CRT scanline overlay effect for retro feel */
.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  z-index: 10;
  opacity: 0.6;
}

/* Vignette border */
.vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.85);
  z-index: 11;
}

/* Audio toggle button */
#audio-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 20;
  background: rgba(15, 15, 25, 0.85);
  border: 1px solid #4a3b63;
  color: #ffca36;
  font-size: 14px;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

#audio-btn:hover {
  background: #2b1f40;
  border-color: #ff9d00;
  transform: scale(1.05);
}
