@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Inter:wght@400;600&display=swap');

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

body {
  font-family: 'Orbitron', 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #0a1a0a, #040d04);
  color: #e0ffe0;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(0,255,100,0.06) 0%, transparent 55%);
  pointer-events: none;
}

h1, .game-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1rem, 4vw, 1.4rem);
  font-weight: 900;
  color: #00ff88;
  text-shadow: 0 0 16px rgba(0,255,136,0.5);
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 14px;
  z-index: 1;
}

#controls {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 12px 16px;
  align-items: center;
  background: rgba(0,255,136,0.05);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,255,136,0.05);
  z-index: 1;
  width: 100%;
  max-width: 700px;
}

#controls label {
  font-size: 0.7rem;
  color: rgba(0,255,136,0.7);
  letter-spacing: 1px;
}

#controls select, #controls input {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(0,255,136,0.3);
  border-radius: 6px;
  color: #00ff88;
  padding: 5px 8px;
  min-height: 44px;
  min-width: 44px;
}

#size {
  width: 74px !important;
}

#speed {
  width: min(180px, 44vw) !important;
}

#patternSelect {
  min-width: min(100%, 168px);
  padding: 10px 12px !important;
  font-size: 0.72rem !important;
}

#controls button, button {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 16px;
  border: 1px solid rgba(0,255,136,0.35);
  border-radius: 8px;
  background: rgba(0,255,136,0.1);
  color: #00ff88;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

button:hover {
  background: rgba(0,255,136,0.22);
  box-shadow: 0 0 14px rgba(0,255,136,0.35);
  transform: translateY(-1px);
}

#generation {
  margin: 8px 0 12px;
  font-size: 0.8rem;
  font-family: 'Orbitron', monospace;
  color: rgba(0,255,136,0.7);
  padding: 8px 16px;
  letter-spacing: 1px;
  z-index: 1;
  background: rgba(0,255,136,0.05);
  border-radius: 8px;
  border: 1px solid rgba(0,255,136,0.15);
}

#controls, #grid-canvas, #generation {
  box-shadow: 0 0 20px rgba(0,255,136,0.06);
}

#grid-canvas {
  border: 1px solid rgba(0,255,136,0.3);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0,255,136,0.1);
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  z-index: 1;
  display: block;
  touch-action: none;
}

@media (max-width: 600px) {
  #controls { gap: 8px; padding: 10px; }
  #controls button, button { padding: 9px 12px; font-size: 0.6rem; }
  #controls label {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

