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

body {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: monospace;
  color: var(--text);
  padding: 16px;
  transition:
    background 0.2s,
    color 0.2s;
}

/* Canvas base — examples add cursor, aspect-ratio, touch-action as needed */
canvas {
  border: 2px solid var(--border);
  display: block;
  width: min(800px, calc(100vw - 32px));
}

/* FPS graph overlay — injected by SQEngine.createFpsTracker when a canvas is passed */
.sq-wrap {
  position: relative;
  line-height: 0;
  flex-shrink: 0;
}

.sq-fps-graph {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 64px;
  height: 24px;
  pointer-events: none;
  border-radius: 3px;
  opacity: 0.9;
}

#hud {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

#hud b {
  color: var(--text);
}

#controls {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
}

#btn-theme {
  background: none;
  border: 1px solid var(--btn-border);
  border-radius: 4px;
  color: var(--btn-text);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 7px;
  font-family: monospace;
  transition: border-color 0.15s;
}

#btn-theme:hover {
  border-color: var(--accent);
}
