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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0a;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#game-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0a0a0a;
}

#canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0a0a0a;
  border-top: 1px solid #1a1a1a;
}

#footer a {
  color: #666;
  text-decoration: none;
  font-size: 12px;
  transition: color 0.2s;
}

#footer a:hover {
  color: #4ade80;
}

/* Desktop centering */
@media (min-width: 600px) {
  #game-container {
    background: linear-gradient(180deg, #0a0a0a 0%, #0f1a0f 100%);
  }
  
  #canvas {
    max-width: 400px;
    max-height: calc(100vh - 80px);
    border-radius: 8px;
    box-shadow: 
      0 0 40px rgba(34, 197, 94, 0.1),
      0 0 80px rgba(34, 197, 94, 0.05);
  }
}

/* Safe area handling for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
  #game-container {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Prevent pull-to-refresh */
body {
  overscroll-behavior-y: contain;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  #footer {
    border-top: 2px solid #333;
  }
  
  #footer a {
    color: #888;
  }
}

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