body {
  margin: 0;
  overflow: hidden;
  background-color: #111;
}

canvas {
  display: block;
}

#info {
  position: absolute;
  top: 10px;
  width: 100%;
  text-align: center;
  color: white;
  font-family: sans-serif;
  pointer-events: none;
  text-shadow: 1px 1px 2px black;
  user-select: none;
  z-index: 10;
}

#instructions {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  color: #ddd;
  font-family: sans-serif;
  pointer-events: none;
  text-shadow: 1px 1px 2px black;
  z-index: 10;
}

#training-ui {
  position: absolute;
  top: 50px;
  right: 20px;
  width: 250px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 15px;
  border-radius: 8px;
  font-family: monospace;
  z-index: 20;
}

#agent-monitor {
  position: absolute;
  top: 50px;
  left: 20px;
  width: 250px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 15px;
  border-radius: 8px;
  font-family: monospace;
  z-index: 20;
}

#vision-container {
  position: absolute;
  top: 250px;
  left: 20px;
  width: 250px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  z-index: 20;
  padding: 10px;
  box-sizing: border-box;
  text-align: center;
}

#graph-container {
  position: absolute;
  bottom: 50px;
  left: 20px;
  width: 250px;
  height: 150px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  z-index: 20;
  padding: 10px;
  box-sizing: border-box;
}

#vision-container h3,
#graph-container h3 {
  margin: 0 0 10px 0;
  color: white;
  font-family: monospace;
  font-size: 14px;
  border-bottom: 1px solid #555;
  padding-bottom: 5px;
  text-align: left;
}

#agent-view-canvas {
  /* Sized from the canvas' own backing store, which the Dashboard derives from
     CONFIG.visionWidth/visionHeight. Hardcoding 128x64 here silently stretched
     the stereo pair as soon as the vision resolution changed. */
  width: 100%;
  height: auto;
  border: 1px solid #444;
  image-rendering: pixelated;
  margin-bottom: 10px;
  background: #000;
}

#kernel-canvas {
  /* height:auto keeps the kernels square; a fixed height stretched them. */
  width: 100%;
  height: auto;
  border: 1px solid #444;
  image-rendering: pixelated;
  margin-bottom: 10px;
}

#act-canvas {
  width: 100%;
  height: 100px;
  border: 1px solid #444;
  background: #111;
}

#loss-canvas {
  width: 100%;
  height: 100px;
  background: #111;
  border: 1px solid #444;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

button {
  width: 100%;
  padding: 8px;
  background: #e66700;
  border: none;
  color: white;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  border-radius: 4px;
}

button:hover {
  background: #ff8533;
}

button.active {
  background: #cc3300;
}

.outcome-score {
  color: #00ff00;
  font-weight: bold;
}

.outcome-rim {
  color: #ffff00;
  font-weight: bold;
}

.outcome-miss {
  color: #ff4444;
  font-weight: bold;
}

.legend {
  font-size: 10px;
  display: flex;
  justify-content: space-around;
  margin-top: 2px;
}

.leg-train {
  color: #44aaff;
}

#tf-backend-status {
  font-size: 10px;
  color: #888;
  text-align: right;
  margin-top: 5px;
}

/* Shot chart. Three columns rather than the two-column .stat-row default:
   zone, what the agent shoots from it, and the bar it is chasing. */
#training-ui .zone-head,
#training-ui .zone-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

#training-ui .zone-head {
  color: #888;
  border-bottom: 1px solid #444;
  padding-bottom: 2px;
}

#training-ui .zone-row span:nth-child(2) {
  text-align: right;
  min-width: 34px;
}

#training-ui .zone-bench {
  color: #888;
  text-align: right;
  min-width: 34px;
}
