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

html, body {
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  overflow: hidden;
}

#map-container {
  position: fixed;
  top: 0; left: 0; right: 0;
  bottom: 28px;
  overflow: hidden;
  cursor: grab;
}

#map-container.grabbing { cursor: grabbing; }

#map-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

#map-canvas,
#train-canvas {
  position: absolute;
  top: 0;
  left: 0;
}

#train-canvas {
  pointer-events: none;
}

#zoom-controls {
  position: fixed;
  bottom: 48px;
  right: 20px;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  z-index: 100;
}

#zoom-controls button {
  width: 40px;
  height: 40px;
  background: #2a2a2a;
  border: none;
  color: #ddd;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#zoom-controls button:first-child {
  border-bottom: 1px solid #444;
}

#zoom-controls button:hover { background: #3a3a3a; }
#zoom-controls button:active { background: #111; }

#status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: #111;
  color: #aaa;
  font: 12px/28px monospace;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
}

#train-count {
  color: #4caf50;
}

#train-tooltip {
  position: fixed;
  z-index: 200;
  display: none;
  pointer-events: none;
  max-width: 280px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px 10px;
  color: #eee;
  font: 12px/1.5 sans-serif;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

#train-tooltip .tt-route {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 4px;
}

#train-tooltip .tt-row { white-space: nowrap; }
#train-tooltip .tt-label { color: #999; display: inline-block; min-width: 70px; }
